diff options
Diffstat (limited to 'libbb/concat_path_file.c')
| -rw-r--r-- | libbb/concat_path_file.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libbb/concat_path_file.c b/libbb/concat_path_file.c index aefb84f45..96fcd4a1d 100644 --- a/libbb/concat_path_file.c +++ b/libbb/concat_path_file.c | |||
| @@ -22,9 +22,15 @@ char* FAST_FUNC concat_path_file(const char *path, const char *filename) | |||
| 22 | 22 | ||
| 23 | if (!path) | 23 | if (!path) |
| 24 | path = ""; | 24 | path = ""; |
| 25 | #if ENABLE_PLATFORM_MINGW32 | ||
| 26 | lc = last_char_is_dir_sep(path); | ||
| 27 | while (is_dir_sep(*filename)) | ||
| 28 | filename++; | ||
| 29 | #else | ||
| 25 | lc = last_char_is(path, '/'); | 30 | lc = last_char_is(path, '/'); |
| 26 | while (*filename == '/') | 31 | while (*filename == '/') |
| 27 | filename++; | 32 | filename++; |
| 33 | #endif | ||
| 28 | return xasprintf("%s%s%s", path, (lc==NULL ? "/" : ""), filename); | 34 | return xasprintf("%s%s%s", path, (lc==NULL ? "/" : ""), filename); |
| 29 | #else | 35 | #else |
| 30 | /* ^^^^^^^^^^^ timing of xasprintf-based code above: | 36 | /* ^^^^^^^^^^^ timing of xasprintf-based code above: |
