- Make dp0 give the directory the batch was run from instead of the current directory.

svn path=/trunk/; revision=32074
This commit is contained in:
Peter Ward 2008-02-01 14:15:41 +00:00
parent cf39f6646d
commit 4e8df678d2
3 changed files with 5 additions and 4 deletions

View file

@ -220,6 +220,7 @@ VOID ExitBatch (LPTSTR msg)
BOOL Batch (LPTSTR fullname, LPTSTR firstword, LPTSTR param)
{
HANDLE hFile;
LPTSTR tmp;
SetLastError(0);
hFile = CreateFile (fullname, GENERIC_READ, FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL |
@ -269,6 +270,8 @@ BOOL Batch (LPTSTR fullname, LPTSTR firstword, LPTSTR param)
}
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;