From 8a99b51cbf1eadc7adcf4d8175ffd451cf87ff22 Mon Sep 17 00:00:00 2001 From: Magnus Olsen Date: Fri, 24 Jun 2005 22:52:21 +0000 Subject: [PATCH] Brandon Turner ) simple check to fix > and | bug with 'rem' I (greatlord / Magnus Olsen) did small change on his patch so it did null terminate the strings right svn path=/trunk/; revision=16262 --- reactos/subsys/system/cmd/redir.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/reactos/subsys/system/cmd/redir.c b/reactos/subsys/system/cmd/redir.c index 6f49624491c..2aeae9bc6e9 100644 --- a/reactos/subsys/system/cmd/redir.c +++ b/reactos/subsys/system/cmd/redir.c @@ -20,6 +20,9 @@ * * 26-Jan-1999 (Eric Kohl ) * Added new error AND output redirection "&>" and "&>>". + * + * 24-Jun-2005 (Brandon Turner ) + * simple check to fix > and | bug with 'rem' */ #include "precomp.h" @@ -54,6 +57,23 @@ INT GetRedirection (LPTSTR s, LPTSTR ifn, LPTSTR ofn, LPTSTR efn, LPINT lpnFlags LPTSTR dp = s; LPTSTR sp = s; +#ifdef INCLUDE_CMD_REM + + TCHAR * line = s; + + while (_istspace (*line)) + line++; + + /*first thing first. check to see if this is "rem" and hope out*/ + if(!_tcsncmp (line, _T("rem "), 4)) + { + lpnFlags = 0; + *ifn=('\0'); + *ofn=('\0'); + *efn=_T('\0'); + return 1; + } +#endif /* find and remove all the redirections first */ while (*sp) {