2 * SHIFT.C - shift internal batch command
7 * 16 Jul 1998 (Hans B Pufal)
10 * 16 Jul 1998 (John P Price)
11 * Separated commands into individual files.
13 * 27-Jul-1998 (John P Price <linux-guru@gcfl.net>)
14 * added config.h include
16 * 07-Jan-1999 (Eric Kohl)
17 * Added help text ("shift /?") and cleaned up.
19 * 20-Jan-1999 (Eric Kohl)
20 * Unicode and redirection safe!
22 * 30-Apr-2005 (Magnus Olsen <magnus@greatlord.com>)
23 * Remove all hardcoded strings in En.rc
29 * Perform the SHIFT command.
31 * Only valid inside batch files.
33 * FREEDOS extension : optional parameter DOWN to allow shifting
34 * parameters backwards.
38 INT
cmd_shift (LPTSTR param
)
41 TRACE ("cmd_shift: (\'%s\')\n", debugstr_aw(param
));
43 if (!_tcsncmp (param
, _T("/?"), 2))
45 ConOutResPaging(TRUE
,STRING_SHIFT_HELP
);
53 /* not in batch - error!! */
58 if (!_tcsicmp (param
, _T("down")))
60 if (bc
->shiftlevel
[0])
66 if (*param
== _T('/'))
68 if (param
[1] < '0' || param
[1] > '9')
70 error_invalid_switch(param
[1]);
77 bc
->shiftlevel
[i
] = bc
->shiftlevel
[i
+ 1];