mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-07 08:08:50 +00:00
Fix path_is_directory for *nix
This commit is contained in:
+3
-3
@@ -480,11 +480,11 @@ wchar_t **command_line_to_wargv(wchar_t *cmd_line, int *_argc) {
|
|||||||
#else
|
#else
|
||||||
bool path_is_directory(String path) {
|
bool path_is_directory(String path) {
|
||||||
gbAllocator a = heap_allocator();
|
gbAllocator a = heap_allocator();
|
||||||
String copy = copy_string(a, path);
|
char *copy = cast(char *)copy_string(a, path).text;
|
||||||
defer (gb_free(a, copy.text));
|
defer (gb_free(a, copy));
|
||||||
|
|
||||||
struct stat s;
|
struct stat s;
|
||||||
if (stat(copy.text, &s) == 0) {
|
if (stat(copy, &s) == 0) {
|
||||||
return (s.st_mode & S_IFDIR) != 0;
|
return (s.st_mode & S_IFDIR) != 0;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user