From bc5a4d71726fdd9b87ece2db019a2b3c87c3b5e6 Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Fri, 3 Jul 2009 19:36:57 +0000 Subject: [PATCH] fix shift. Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3439 --- include/shell.h | 3 ++- src/shell/shell_batch.cpp | 11 ++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/include/shell.h b/include/shell.h index 02edab16..b6799bee 100644 --- a/include/shell.h +++ b/include/shell.h @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: shell.h,v 1.27 2009-05-27 09:15:41 qbix79 Exp $ */ +/* $Id: shell.h,v 1.28 2009-07-03 19:36:57 qbix79 Exp $ */ #ifndef DOSBOX_SHELL_H #define DOSBOX_SHELL_H @@ -55,6 +55,7 @@ public: DOS_Shell * shell; BatchFile * prev; CommandLine * cmd; + std::string filename; }; class AutoexecEditor; diff --git a/src/shell/shell_batch.cpp b/src/shell/shell_batch.cpp index 9bf40070..3d4c1668 100644 --- a/src/shell/shell_batch.cpp +++ b/src/shell/shell_batch.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: shell_batch.cpp,v 1.35 2009-05-27 09:15:42 qbix79 Exp $ */ +/* $Id: shell_batch.cpp,v 1.36 2009-07-03 19:36:56 qbix79 Exp $ */ #include #include @@ -32,6 +32,7 @@ BatchFile::BatchFile(DOS_Shell * host,char const * const name, char const * cons char totalname[DOS_PATHLENGTH+4]; DOS_Canonicalize(name,totalname); // Get fullname including drive specificiation cmd = new CommandLine(totalname,cmd_line); + filename = totalname; //Test if file is openable if (!DOS_OpenFile(totalname,128,&file_handle)) { @@ -49,8 +50,8 @@ BatchFile::~BatchFile() { bool BatchFile::ReadLine(char * line) { //Open the batchfile and seek to stored postion - if (!DOS_OpenFile(cmd->GetFileName(),128,&file_handle)) { - LOG(LOG_MISC,LOG_ERROR)("ReadLine Can't open BatchFile %s",cmd->GetFileName()); + if (!DOS_OpenFile(filename.c_str(),128,&file_handle)) { + LOG(LOG_MISC,LOG_ERROR)("ReadLine Can't open BatchFile %s",filename.c_str()); delete this; return false; } @@ -143,8 +144,8 @@ emptyline: bool BatchFile::Goto(char * where) { //Open bat file and search for the where string - if (!DOS_OpenFile(cmd->GetFileName(),128,&file_handle)) { - LOG(LOG_MISC,LOG_ERROR)("SHELL:Goto Can't open BatchFile %s",cmd->GetFileName()); + if (!DOS_OpenFile(filename.c_str(),128,&file_handle)) { + LOG(LOG_MISC,LOG_ERROR)("SHELL:Goto Can't open BatchFile %s",filename.c_str()); delete this; return false; }