Skip to content

Commit 5a06a20

Browse files
Ben Peartgitster
authored andcommitted
handle lower case drive letters on Windows
On Windows, if a tool calls SetCurrentDirectory with a lower case drive letter, the subsequent call to GetCurrentDirectory will return the same lower case drive letter. Powershell, for example, does not normalize the path. If that happens, test-drop-caches will error out as it does not correctly to handle lower case drive letters. Helped-by: Johannes Schindelin <[email protected]> Signed-off-by: Ben Peart <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 53f9a3e commit 5a06a20

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

t/helper/test-drop-caches.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ static int cmd_sync(void)
1616
if ((0 == dwRet) || (dwRet > MAX_PATH))
1717
return error("Error getting current directory");
1818

19-
if ((Buffer[0] < 'A') || (Buffer[0] > 'Z'))
20-
return error("Invalid drive letter '%c'", Buffer[0]);
19+
if (!has_dos_drive_prefix(Buffer))
20+
return error("'%s': invalid drive letter", Buffer);
2121

2222
szVolumeAccessPath[4] = Buffer[0];
2323
hVolWrite = CreateFile(szVolumeAccessPath, GENERIC_READ | GENERIC_WRITE,

0 commit comments

Comments
 (0)