path: root/t/
diff options
authorJohannes Schindelin <>2020-04-08 18:06:49 (GMT)
committerJunio C Hamano <>2020-04-08 19:15:51 (GMT)
commitb6852e19794245566f7c961a434c56ca3b7a883b (patch)
tree53b9c597b2f5dacffd158b349033c15f026641b9 /t/
parenta748f3f3dc0adff1d8a83dfc098ed819658998d0 (diff)
mingw: do not treat `COM0` as a reserved file name
In 4dc42c6c186 (mingw: refuse paths containing reserved names, 2019-12-21), we started disallowing file names that are reserved, e.g. `NUL`, `CONOUT$`, etc. This included `COM<n>` where `<n>` is a digit. Unfortunately, this includes `COM0` but only `COM1`, ..., `COM9` are reserved, according to the official documentation, `COM0` is mentioned in the "NT Namespaces" section but it is explicitly _omitted_ from the list of reserved names: Tests corroborate this: it is totally possible to write a file called `com0.c` on Windows 10, but not `com1.c`. So let's tighten the code to disallow only the reserved `COM<n>` file names, but to allow `COM0` again. This fixes Signed-off-by: Johannes Schindelin <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 't/')
1 files changed, 2 insertions, 0 deletions
diff --git a/t/ b/t/
index 2ea2d00..56db5c8 100755
--- a/t/
+++ b/t/
@@ -476,6 +476,7 @@ test_expect_success MINGW 'is_valid_path() on Windows' '
C:\\git \
comm \
conout.c \
+ com0.c \
lptN \
--not \
@@ -488,6 +489,7 @@ test_expect_success MINGW 'is_valid_path() on Windows' '
"AUX.c" \
"abc/conOut\$ .xyz/test" \
lpt8 \
+ com9.c \
"lpt*" \
Nul \