1
0
Fork 0

don't parse redirection when in quotes

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2380
This commit is contained in:
Peter Veenstra 2005-11-20 20:15:16 +00:00
parent 0797de3e25
commit 1b9f9c0169

View file

@ -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 <stdlib.h>
#include <stdarg.h>
@ -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++;