diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2021-02-01 12:33:27 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2021-02-01 12:33:27 -0500 |
commit | 11b50663dc489b7ec8cb1c8774d9bda2c7acac3b (patch) | |
tree | aa604b767286c86b21b6fef851f0c74e8dfc0acb /filesystem-win.c | |
parent | dba51f5c1b7ac895239d2909358b323a92b77644 (diff) |
full C syntax highlighting
Diffstat (limited to 'filesystem-win.c')
-rw-r--r-- | filesystem-win.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/filesystem-win.c b/filesystem-win.c index d9ff143..f27fe82 100644 --- a/filesystem-win.c +++ b/filesystem-win.c @@ -22,7 +22,9 @@ char **fs_list_directory(char const *dirname) { char **ret = NULL; WIN32_FIND_DATA find_data; HANDLE fhandle; - sprintf_s(file_pattern, sizeof file_pattern, "%s\\*", dirname); + assert(*dirname); + sprintf_s(file_pattern, sizeof file_pattern, "%s%s*", dirname, + dirname[strlen(dirname) - 1] == PATH_SEPARATOR ? "" : PATH_SEPARATOR_STR); fhandle = FindFirstFileA(file_pattern, &find_data); if (fhandle != INVALID_HANDLE_VALUE) { // first, figure out number of files |