diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c index e738626a6fd..0e95cc34544 100644 --- a/programs/cmd/builtins.c +++ b/programs/cmd/builtins.c @@ -186,11 +186,11 @@ void WCMD_choice (WCHAR * command) { have_console = GetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), &oldmode); errorlevel = 0; - my_command = WCMD_strdupW(WCMD_strtrim_leading_spaces(command)); + my_command = WCMD_strdupW(WCMD_skip_leading_spaces(command)); if (!my_command) return; - ptr = WCMD_strtrim_leading_spaces(my_command); + ptr = WCMD_skip_leading_spaces(my_command); while (*ptr == '/') { switch (toupperW(ptr[1])) { case 'C': @@ -213,19 +213,19 @@ void WCMD_choice (WCHAR * command) { if (*ptr) { /* terminate allowed chars */ *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)); break; case 'N': opt_n = TRUE; - ptr = WCMD_strtrim_leading_spaces(&ptr[2]); + ptr = WCMD_skip_leading_spaces(&ptr[2]); break; case 'S': opt_s = TRUE; - ptr = WCMD_strtrim_leading_spaces(&ptr[2]); + ptr = WCMD_skip_leading_spaces(&ptr[2]); break; case 'T': @@ -252,7 +252,7 @@ void WCMD_choice (WCHAR * command) { answer[count] = 0; opt_timeout = atoiW(answer); - ptr = WCMD_strtrim_leading_spaces(ptr); + ptr = WCMD_skip_leading_spaces(ptr); break; default: @@ -1315,7 +1315,7 @@ void WCMD_give_help (WCHAR *command) { int i; - command = WCMD_strtrim_leading_spaces(command); + command = WCMD_skip_leading_spaces(command); if (strlenW(command) == 0) { WCMD_output_asis (WCMD_LoadMessage(WCMD_ALLHELP)); } diff --git a/programs/cmd/wcmd.h b/programs/cmd/wcmd.h index 0c7f622c8a2..1104d8e2b99 100644 --- a/programs/cmd/wcmd.h +++ b/programs/cmd/wcmd.h @@ -96,7 +96,7 @@ int WCMD_volume (int mode, WCHAR *command); WCHAR *WCMD_fgets (WCHAR *s, int n, HANDLE stream); 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_splitpath(const WCHAR* path, WCHAR* drv, WCHAR* dir, WCHAR* name, WCHAR* ext); diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c index 2018a12e138..c23fefdfcf2 100644 --- a/programs/cmd/wcmdmain.c +++ b/programs/cmd/wcmdmain.c @@ -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 - * non-space character. Does not modify the input string + * Return a pointer to the first non-space character of string. + * Does not modify the input string. */ -WCHAR *WCMD_strtrim_leading_spaces (WCHAR *string) { +WCHAR *WCMD_skip_leading_spaces (WCHAR *string) { WCHAR *ptr; @@ -1392,7 +1392,7 @@ void WCMD_execute (WCHAR *command, WCHAR *redirects, /* * 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)); if (whichcmd[0] == '@') whichcmd++; @@ -1409,7 +1409,7 @@ void WCMD_execute (WCHAR *command, WCHAR *redirects, if (CompareStringW(LOCALE_USER_DEFAULT, NORM_IGNORECASE | SORT_STRINGSORT, 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); WINE_TRACE("param1: %s, param2: %s\n", wine_dbgstr_w(param1), wine_dbgstr_w(param2));