diff options
author | Lautis Sun <lautis0503@gmail.com> | 2016-07-19 05:01:43 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-19 05:01:43 +0300 |
commit | 4b25fece7efcf3880b3a9746a4bf90c32667a9a4 (patch) | |
tree | a8440cb6580f102c065002d5668f17dc844225a9 | |
parent | 0e7b5edc54da6a0e38a06677a47ae5e717f3e0a6 (diff) |
Test if a unicode string is empty
-rw-r--r-- | tinydir.h | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -643,7 +643,11 @@ int tinydir_file_open(tinydir_file *file, const _tinydir_char_t *path) } /* Emulate the behavior of dirname by returning "." for dir name if it's empty */ +#if ((defined _MSC_VER || defined __MINGW32__) && (defined UNICODE)) + if (drive_buf[0] == '\0' && drive_buf[1] == '\0' && dir_name_buf[0] == '\0' && dir_name_buf[1] == '\0') +#else if (drive_buf[0] == '\0' && dir_name_buf[0] == '\0') +#endif { _tinydir_strcpy(dir_name_buf, TINYDIR_STRING(".")); } |