mirror of
https://github.com/raysan5/raylib.git
synced 2026-11-25 09:01:47 -05:00
Compare commits
2 Commits
3b12ba162b
...
4bfb72d8ff
| Author | SHA1 | Date | |
|---|---|---|---|
| 4bfb72d8ff | |||
| 4670834827 |
@ -182,11 +182,14 @@
|
||||
#endif
|
||||
|
||||
#define _CRT_INTERNAL_NONSTDC_NAMES 1
|
||||
#include <sys/stat.h> // Required for: stat(), S_ISREG [Used in GetFileModTime(), IsFilePath()]
|
||||
#include <sys/stat.h> // Required for: stat(), S_ISREG, S_ISDIR [Used in GetFileModTime(), IsPathFile(), IsPathDirectory()]
|
||||
|
||||
#if !defined(S_ISREG) && defined(S_IFMT) && defined(S_IFREG)
|
||||
#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
|
||||
#endif
|
||||
#if !defined(S_ISDIR) && defined(S_IFMT) && defined(S_IFDIR)
|
||||
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) && (defined(_MSC_VER) || defined(__TINYC__))
|
||||
#define DIRENT_MALLOC RL_MALLOC
|
||||
@ -2880,7 +2883,8 @@ bool IsPathDirectory(const char *path)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
if (!IsPathFile(path)) result = true;
|
||||
struct stat info = { 0 };
|
||||
if ((stat(path, &info) == 0) && S_ISDIR(info.st_mode)) result = true;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -2100,10 +2100,10 @@ char **TextSplit(const char *text, char delimiter, int *count)
|
||||
else if (buffer[i] == delimiter)
|
||||
{
|
||||
buffer[i] = '\0'; // Set an end of string at this point
|
||||
if (counter == MAX_TEXTSPLIT_COUNT) break; // No room for more substrings, keep the last one complete
|
||||
|
||||
buffers[counter] = buffer + i + 1;
|
||||
counter++;
|
||||
|
||||
if (counter == MAX_TEXTSPLIT_COUNT) break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user