From 6d1979bb9d3c9805eda86603d08a21849c5224d6 Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Sun, 27 Jul 2008 20:12:28 +0000 Subject: [PATCH] Make max 50% in autoexec.bat possible. Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3186 --- src/shell/shell.cpp | 12 ++++++------ src/shell/shell_batch.cpp | 6 ++++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/shell/shell.cpp b/src/shell/shell.cpp index 2e6276b5..1e7c6a25 100644 --- a/src/shell/shell.cpp +++ b/src/shell/shell.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: shell.cpp,v 1.89 2008-03-02 11:13:47 qbix79 Exp $ */ +/* $Id: shell.cpp,v 1.90 2008-07-27 20:12:28 qbix79 Exp $ */ #include #include @@ -270,8 +270,8 @@ void DOS_Shell::RunInternal(void) if (echo) { if (input_line[0] != '@') { ShowPrompt(); - WriteOut(input_line); - WriteOut("\n"); + WriteOut_NoParsing(input_line); + WriteOut_NoParsing("\n"); }; }; ParseLine(input_line); @@ -318,8 +318,8 @@ void DOS_Shell::Run(void) { if (echo) { if (input_line[0]!='@') { ShowPrompt(); - WriteOut(input_line); - WriteOut("\n"); + WriteOut_NoParsing(input_line); + WriteOut_NoParsing("\n"); }; }; ParseLine(input_line); @@ -329,7 +329,7 @@ void DOS_Shell::Run(void) { if (echo) ShowPrompt(); InputCommand(input_line); ParseLine(input_line); - if (echo && !bf) WriteOut("\n"); + if (echo && !bf) WriteOut_NoParsing("\n"); } } while (!exit); } diff --git a/src/shell/shell_batch.cpp b/src/shell/shell_batch.cpp index d16e748a..a8b9ce4c 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.27 2008-03-10 13:43:37 qbix79 Exp $ */ +/* $Id: shell_batch.cpp,v 1.28 2008-07-27 20:12:28 qbix79 Exp $ */ #include #include @@ -100,7 +100,9 @@ emptyline: } else { /* Not a command line number has to be an environment */ char * first=strchr(cmd_read,'%'); - if (!first) continue; *first++=0; + /* No env afterall.Somewhat of a hack though as %% and % aren't handled consistent in dosbox. Maybe echo needs to parse % and %% as well. */ + if (!first) {*cmd_write++ = '%';continue;} + *first++ = 0; std::string env; if (shell->GetEnvStr(cmd_read,env)) { const char * equals=strchr(env.c_str(),'=');