From 189e2f0313eb6cc96e92d2c7efb790cb4d9849a4 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Wed, 12 Mar 2014 16:39:29 +0100 Subject: erts: Ignore reduntant slashes in windows paths --- erts/emulator/drivers/win32/win_efile.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'erts/emulator') 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; } -- cgit v1.2.3