From 386e3e22c069cc306c6e0bd22fba824e1e13a7d9 Mon Sep 17 00:00:00 2001 From: Javier Date: Sat, 18 Feb 2023 15:48:41 +0100 Subject: replace .??? wildcards with a plain '*' Before, patterns like 'test.???' would be passed as 'test' incorrectly. This fixes command.com which uses this pattern when searching for executable files. --- sftsr.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sftsr.c b/sftsr.c index 73f09d5..0e9915f 100644 --- a/sftsr.c +++ b/sftsr.c @@ -277,11 +277,12 @@ static void fix_wildcards(SHFLSTRING *str, bool expand_tilde) str->u16Length = i + 1; } } else if (str->u16Length >= 1+3) { - // If this ends with .???, remove it, since we want to accept files - // without extension too. + // Also, if this ends with .???, replace it with *, + // for the same reason. i = str->u16Length - (1+3); if (memcmp(&str->ach[i], ".???", (1+3)) == 0) { - str->u16Length = i; + strcpy(&str->ach[i], "*"); + str->u16Length = i + 1; } } -- cgit v1.2.3