diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-08-05 21:16:38 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-08-05 21:16:38 +0000 |
commit | 917aafaa99163e731d76b471e9975a8947a35a60 (patch) | |
tree | 4dd7b854c731abbb104692f8dbbd1939b96a09f7 /src/fs/fs_file_information.c | |
parent | cb41db74f56afaa480d834c4756ecb6ac6bf8258 (diff) | |
download | gnunet-917aafaa99163e731d76b471e9975a8947a35a60.tar.gz gnunet-917aafaa99163e731d76b471e9975a8947a35a60.zip |
LRN: 0006-Use-plibc-to-convert-dir-separators.patch
Diffstat (limited to 'src/fs/fs_file_information.c')
-rw-r--r-- | src/fs/fs_file_information.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/fs/fs_file_information.c b/src/fs/fs_file_information.c index e920bf46b..62ae285d8 100644 --- a/src/fs/fs_file_information.c +++ b/src/fs/fs_file_information.c | |||
@@ -149,6 +149,9 @@ GNUNET_FS_file_information_create_from_file (struct GNUNET_FS_Handle *h, | |||
149 | struct GNUNET_FS_FileInformation *ret; | 149 | struct GNUNET_FS_FileInformation *ret; |
150 | const char *fn; | 150 | const char *fn; |
151 | const char *ss; | 151 | const char *ss; |
152 | #if WINDOWS | ||
153 | char fn_conv[MAX_PATH]; | ||
154 | #endif | ||
152 | 155 | ||
153 | if (0 != STAT (filename, &sbuf)) | 156 | if (0 != STAT (filename, &sbuf)) |
154 | { | 157 | { |
@@ -176,7 +179,12 @@ GNUNET_FS_file_information_create_from_file (struct GNUNET_FS_Handle *h, | |||
176 | return NULL; | 179 | return NULL; |
177 | ret->h = h; | 180 | ret->h = h; |
178 | ret->filename = GNUNET_strdup (filename); | 181 | ret->filename = GNUNET_strdup (filename); |
182 | #if !WINDOWS | ||
179 | fn = filename; | 183 | fn = filename; |
184 | #else | ||
185 | plibc_conv_to_win_path (filename, fn_conv); | ||
186 | fn = fn_conv; | ||
187 | #endif | ||
180 | while (NULL != (ss = strstr (fn, | 188 | while (NULL != (ss = strstr (fn, |
181 | DIR_SEPARATOR_STR))) | 189 | DIR_SEPARATOR_STR))) |
182 | fn = ss + 1; | 190 | fn = ss + 1; |