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:
Jason Edmeades 2007-04-05 22:47:53 +01:00 committed by Alexandre Julliard
parent 7657913873
commit b573f68b36

View File

@ -877,9 +877,12 @@ void WCMD_run_program (char *command, int called) {
strcat(thisDir, stemofsearch);
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) {
found = TRUE;
}
}
/* 2. Any .* matches? */
if (!found) {