Skip to content

Commit 0a6fb47

Browse files
committed
mingw: keep trailing slashes for _wchdir() and readlink()
This is needed so that `_wchdir()` can be used with drive root directories, e.g. C:\ (`_wchdir("C:")` fails to switch the directory to the root directory). This fixes msysgit#359 (in Git for Windows 2.x only, though). Likewise, `readlink()`'s semantics require a trailing slash for symbolic links pointing to directories. Otherwise all checked out symbolic links pointing to directories would be marked as modified even directly after a fresh clone. This fixes #210 Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 908c449 commit 0a6fb47

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

compat/mingw.c

-3
Original file line numberDiff line numberDiff line change
@@ -419,9 +419,6 @@ static wchar_t *normalize_ntpath(wchar_t *wbuf)
419419
for (i = 0; wbuf[i]; i++)
420420
if (wbuf[i] == '\\')
421421
wbuf[i] = '/';
422-
/* remove potential trailing slashes */
423-
while (i && wbuf[i - 1] == '/')
424-
wbuf[--i] = 0;
425422
return wbuf;
426423
}
427424

0 commit comments

Comments
 (0)