diff options
author | Javier <dev.git@javispedro.com> | 2023-02-18 15:48:41 +0100 |
---|---|---|
committer | Javier <dev.git@javispedro.com> | 2023-02-18 15:48:41 +0100 |
commit | 386e3e22c069cc306c6e0bd22fba824e1e13a7d9 (patch) | |
tree | cfa4966e563d7f27011f32165babe37f6f655cc9 | |
parent | 4e62ff17398cbbe00ecd8cdcb1c791ab96b60c9c (diff) | |
download | vbados-386e3e22c069cc306c6e0bd22fba824e1e13a7d9.tar.gz vbados-386e3e22c069cc306c6e0bd22fba824e1e13a7d9.zip |
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.
-rw-r--r-- | sftsr.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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; } } |