Commit bb47576f authored by Frédéric Delanoy's avatar Frédéric Delanoy Committed by Alexandre Julliard

cmd: Rename WCMD_strtrim_leading_spaces to WCMD_skip_leading_spaces to better reflect its purpose.

parent 303af43f
...@@ -186,11 +186,11 @@ void WCMD_choice (WCHAR * command) { ...@@ -186,11 +186,11 @@ void WCMD_choice (WCHAR * command) {
have_console = GetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), &oldmode); have_console = GetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), &oldmode);
errorlevel = 0; errorlevel = 0;
my_command = WCMD_strdupW(WCMD_strtrim_leading_spaces(command)); my_command = WCMD_strdupW(WCMD_skip_leading_spaces(command));
if (!my_command) if (!my_command)
return; return;
ptr = WCMD_strtrim_leading_spaces(my_command); ptr = WCMD_skip_leading_spaces(my_command);
while (*ptr == '/') { while (*ptr == '/') {
switch (toupperW(ptr[1])) { switch (toupperW(ptr[1])) {
case 'C': case 'C':
...@@ -213,19 +213,19 @@ void WCMD_choice (WCHAR * command) { ...@@ -213,19 +213,19 @@ void WCMD_choice (WCHAR * command) {
if (*ptr) { if (*ptr) {
/* terminate allowed chars */ /* terminate allowed chars */
*ptr = 0; *ptr = 0;
ptr = WCMD_strtrim_leading_spaces(&ptr[1]); ptr = WCMD_skip_leading_spaces(&ptr[1]);
} }
WINE_TRACE("answer-list: %s\n", wine_dbgstr_w(opt_c)); WINE_TRACE("answer-list: %s\n", wine_dbgstr_w(opt_c));
break; break;
case 'N': case 'N':
opt_n = TRUE; opt_n = TRUE;
ptr = WCMD_strtrim_leading_spaces(&ptr[2]); ptr = WCMD_skip_leading_spaces(&ptr[2]);
break; break;
case 'S': case 'S':
opt_s = TRUE; opt_s = TRUE;
ptr = WCMD_strtrim_leading_spaces(&ptr[2]); ptr = WCMD_skip_leading_spaces(&ptr[2]);
break; break;
case 'T': case 'T':
...@@ -252,7 +252,7 @@ void WCMD_choice (WCHAR * command) { ...@@ -252,7 +252,7 @@ void WCMD_choice (WCHAR * command) {
answer[count] = 0; answer[count] = 0;
opt_timeout = atoiW(answer); opt_timeout = atoiW(answer);
ptr = WCMD_strtrim_leading_spaces(ptr); ptr = WCMD_skip_leading_spaces(ptr);
break; break;
default: default:
...@@ -1315,7 +1315,7 @@ void WCMD_give_help (WCHAR *command) { ...@@ -1315,7 +1315,7 @@ void WCMD_give_help (WCHAR *command) {
int i; int i;
command = WCMD_strtrim_leading_spaces(command); command = WCMD_skip_leading_spaces(command);
if (strlenW(command) == 0) { if (strlenW(command) == 0) {
WCMD_output_asis (WCMD_LoadMessage(WCMD_ALLHELP)); WCMD_output_asis (WCMD_LoadMessage(WCMD_ALLHELP));
} }
......
...@@ -96,7 +96,7 @@ int WCMD_volume (int mode, WCHAR *command); ...@@ -96,7 +96,7 @@ int WCMD_volume (int mode, WCHAR *command);
WCHAR *WCMD_fgets (WCHAR *s, int n, HANDLE stream); WCHAR *WCMD_fgets (WCHAR *s, int n, HANDLE stream);
WCHAR *WCMD_parameter (WCHAR *s, int n, WCHAR **where); WCHAR *WCMD_parameter (WCHAR *s, int n, WCHAR **where);
WCHAR *WCMD_strtrim_leading_spaces (WCHAR *string); WCHAR *WCMD_skip_leading_spaces (WCHAR *string);
void WCMD_HandleTildaModifiers(WCHAR **start, WCHAR *forVariable, WCHAR *forValue, BOOL justFors); void WCMD_HandleTildaModifiers(WCHAR **start, WCHAR *forVariable, WCHAR *forValue, BOOL justFors);
void WCMD_splitpath(const WCHAR* path, WCHAR* drv, WCHAR* dir, WCHAR* name, WCHAR* ext); void WCMD_splitpath(const WCHAR* path, WCHAR* drv, WCHAR* dir, WCHAR* name, WCHAR* ext);
......
...@@ -441,12 +441,12 @@ void WCMD_strsubstW(WCHAR* start, WCHAR* next, WCHAR* insert, int len) { ...@@ -441,12 +441,12 @@ void WCMD_strsubstW(WCHAR* start, WCHAR* next, WCHAR* insert, int len) {
} }
/*************************************************************************** /***************************************************************************
* WCMD_strtrim_leading_spaces * WCMD_skip_leading_spaces
* *
* Remove leading spaces from a string. Return a pointer to the first * Return a pointer to the first non-space character of string.
* non-space character. Does not modify the input string * Does not modify the input string.
*/ */
WCHAR *WCMD_strtrim_leading_spaces (WCHAR *string) { WCHAR *WCMD_skip_leading_spaces (WCHAR *string) {
WCHAR *ptr; WCHAR *ptr;
...@@ -1392,7 +1392,7 @@ void WCMD_execute (WCHAR *command, WCHAR *redirects, ...@@ -1392,7 +1392,7 @@ void WCMD_execute (WCHAR *command, WCHAR *redirects,
/* /*
* Strip leading whitespaces, and a '@' if supplied * Strip leading whitespaces, and a '@' if supplied
*/ */
whichcmd = WCMD_strtrim_leading_spaces(cmd); whichcmd = WCMD_skip_leading_spaces(cmd);
WINE_TRACE("Command: '%s'\n", wine_dbgstr_w(cmd)); WINE_TRACE("Command: '%s'\n", wine_dbgstr_w(cmd));
if (whichcmd[0] == '@') whichcmd++; if (whichcmd[0] == '@') whichcmd++;
...@@ -1409,7 +1409,7 @@ void WCMD_execute (WCHAR *command, WCHAR *redirects, ...@@ -1409,7 +1409,7 @@ void WCMD_execute (WCHAR *command, WCHAR *redirects,
if (CompareStringW(LOCALE_USER_DEFAULT, NORM_IGNORECASE | SORT_STRINGSORT, if (CompareStringW(LOCALE_USER_DEFAULT, NORM_IGNORECASE | SORT_STRINGSORT,
whichcmd, count, inbuilt[i], -1) == CSTR_EQUAL) break; whichcmd, count, inbuilt[i], -1) == CSTR_EQUAL) break;
} }
p = WCMD_strtrim_leading_spaces (&whichcmd[count]); p = WCMD_skip_leading_spaces (&whichcmd[count]);
WCMD_parse (p, quals, param1, param2); WCMD_parse (p, quals, param1, param2);
WINE_TRACE("param1: %s, param2: %s\n", wine_dbgstr_w(param1), wine_dbgstr_w(param2)); WINE_TRACE("param1: %s, param2: %s\n", wine_dbgstr_w(param1), wine_dbgstr_w(param2));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment