From 94d7c8db7d6d6d71caf391d777e273d550fbb176 Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Mon, 10 Mar 2008 13:43:37 +0000 Subject: [PATCH] don't parse above 9 Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3119 --- src/shell/shell_batch.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/shell/shell_batch.cpp b/src/shell/shell_batch.cpp index 84893f7b..d16e748a 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.26 2007-10-28 10:58:50 qbix79 Exp $ */ +/* $Id: shell_batch.cpp,v 1.27 2008-03-10 13:43:37 qbix79 Exp $ */ #include #include @@ -86,14 +86,14 @@ emptyline: cmd_write+=strlen(file_name); continue; } - size_t len=strspn(cmd_read,"123456789"); - if (len) { /* Handle %1 %2 .. %9 */ - memcpy(env_name,cmd_read,len); - env_name[len]=0;cmd_read+=len; - len=atoi(env_name); - if (cmd->GetCount() '0' && next <= '9') { + /* Handle %1 %2 .. %9 */ + cmd_read++; //Progress reader + next -= '0'; + if (cmd->GetCount()FindCommand(len,word)) continue; + if (!cmd->FindCommand(next,word)) continue; strcpy(cmd_write,word.c_str()); cmd_write+=strlen(word.c_str()); continue;