mirror of
https://github.com/reactos/reactos.git
synced 2025-07-16 05:34:05 +00:00
- Fix cmd's SearchForExecutable: it was inside out, giving extension priority over directory.
- Remove code that checked if the file's extension was in PATHEXT. Windows does not check, and it's very handy to be able to "run" non-executable files. - Allow explicit paths with no backslash (like "A:file") - Batch: use GetFullPathName to get the batch file's absolute path; this way %~dp0 will always give the right directory even in the weird case of running the .bat via a relative path in PATH. Remove code in SearchForExecutable which tried to make sure it returned an absolute path (but it didn't in that case). svn path=/trunk/; revision=35187
This commit is contained in:
parent
fbb7095a67
commit
b75ff606ba
2 changed files with 54 additions and 107 deletions
|
@ -263,10 +263,10 @@ BOOL Batch (LPTSTR fullname, LPTSTR firstword, LPTSTR param)
|
|||
cmd_free (bc->raw_params);
|
||||
}
|
||||
|
||||
ZeroMemory(bc->BatchFilePath, sizeof(bc->BatchFilePath));
|
||||
GetFullPathName(fullname, sizeof(bc->BatchFilePath), bc->BatchFilePath, &tmp);
|
||||
*tmp = '\0';
|
||||
|
||||
bc->hBatchFile = hFile;
|
||||
tmp = _tcsrchr(fullname, '\\');
|
||||
_tcsncpy(bc->BatchFilePath, fullname, ((_tcslen(fullname) - _tcslen(tmp)) + 1));
|
||||
SetFilePointer (bc->hBatchFile, 0, NULL, FILE_BEGIN);
|
||||
bc->bEcho = bEcho; /* Preserve echo across batch calls */
|
||||
bc->shiftlevel = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue