Skip to content

Commit

Permalink
mingw: keep trailing slashes for _wchdir() and readlink()
Browse files Browse the repository at this point in the history
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 git-for-windows#210

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Aug 26, 2017
1 parent 3a25cca commit 6236be9
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions compat/mingw.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,9 +375,6 @@ static wchar_t *normalize_ntpath(wchar_t *wbuf)
for (i = 0; wbuf[i]; i++)
if (wbuf[i] == '\\')
wbuf[i] = '/';
/* remove potential trailing slashes */
while (i && wbuf[i - 1] == '/')
wbuf[--i] = 0;
return wbuf;
}

Expand Down

0 comments on commit 6236be9

Please sign in to comment.