cmd.exe: Only search for supplied command as-is if it includes an extension.
Files with no extensions cannot be run as-is. This enables a directory with 'fred' and 'fred.bat' to correctly run fred.bat if just fred is executed.
This commit is contained in:
parent
7657913873
commit
b573f68b36
@ -877,9 +877,12 @@ void WCMD_run_program (char *command, int called) {
|
|||||||
strcat(thisDir, stemofsearch);
|
strcat(thisDir, stemofsearch);
|
||||||
pos = &thisDir[strlen(thisDir)]; /* Pos = end of name */
|
pos = &thisDir[strlen(thisDir)]; /* Pos = end of name */
|
||||||
|
|
||||||
|
/* 1. If extension supplied, see if that file exists */
|
||||||
|
if (extensionsupplied) {
|
||||||
if (GetFileAttributes(thisDir) != INVALID_FILE_ATTRIBUTES) {
|
if (GetFileAttributes(thisDir) != INVALID_FILE_ATTRIBUTES) {
|
||||||
found = TRUE;
|
found = TRUE;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* 2. Any .* matches? */
|
/* 2. Any .* matches? */
|
||||||
if (!found) {
|
if (!found) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user