diff options
author | Sverker Eriksson <[email protected]> | 2014-03-12 16:39:29 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2014-03-13 14:31:01 +0100 |
commit | 189e2f0313eb6cc96e92d2c7efb790cb4d9849a4 (patch) | |
tree | 67d5beac54532bad418174de2fdab4f127629a88 | |
parent | 4fa7202d3c816834e39cf7dce7aa10591babbf61 (diff) | |
download | otp-189e2f0313eb6cc96e92d2c7efb790cb4d9849a4.tar.gz otp-189e2f0313eb6cc96e92d2c7efb790cb4d9849a4.tar.bz2 otp-189e2f0313eb6cc96e92d2c7efb790cb4d9849a4.zip |
erts: Ignore reduntant slashes in windows paths
-rw-r--r-- | erts/emulator/drivers/win32/win_efile.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/erts/emulator/drivers/win32/win_efile.c b/erts/emulator/drivers/win32/win_efile.c index afb0252724..c25fb34637 100644 --- a/erts/emulator/drivers/win32/win_efile.c +++ b/erts/emulator/drivers/win32/win_efile.c @@ -370,8 +370,16 @@ static void ensure_wpath_max(Efile_call_state* state, WCHAR** pathp, size_t max) *pathp = wpath_tmp_alloc(state, 4+len+1); dst = *pathp; wcscpy(dst, L"\\\\?\\"); - for (src=path,dst+=4; *src; src++,dst++) - *dst = (*src == L'/') ? L'\\' : *src; + for (src=path,dst+=4; *src; src++) { + if (*src == L'/') { + if (dst[-1] != L'\\') { + *dst++ = L'\\'; + } + /*else ignore redundant slashes */ + } + else + *dst++ = *src; + } *dst = 0; unc_fixup = 1; } |