From 1b9f9c016941dc3b12c4823141e3379bcd8277a1 Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Sun, 20 Nov 2005 20:15:16 +0000 Subject: [PATCH] don't parse redirection when in quotes Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2380 --- src/shell/shell.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/shell/shell.cpp b/src/shell/shell.cpp index 95d8c472..9a463917 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.63 2005-09-29 08:48:39 qbix79 Exp $ */ +/* $Id: shell.cpp,v 1.64 2005-11-20 20:15:16 qbix79 Exp $ */ #include #include @@ -116,9 +116,18 @@ Bitu DOS_Shell::GetRedirection(char *s, char **ifn, char **ofn,bool * append) { char * lw=s; char ch; Bitu num=0; + bool quote = false; while ( (ch=*lr++) ) { + if(quote) { /* don't parse redirection within quotes. Not perfect yet. Escaped quotes will mess the count up */ + *lw++ = ch; + continue; + } + switch (ch) { + case '"': + quote = !quote; + break; case '>': *append=((*lr)=='>'); if (*append) lr++;