cmd: Respect constant wide strings naming convention.
This commit is contained in:
parent
7cf307a7bd
commit
668e44ab26
|
@ -475,13 +475,13 @@ void WCMD_HandleTildaModifiers(WCHAR **start, const WCHAR *forVariable,
|
|||
int datelen;
|
||||
|
||||
doneModifier = TRUE;
|
||||
if (finaloutput[0] != 0x00) strcatW(finaloutput, space);
|
||||
if (finaloutput[0] != 0x00) strcatW(finaloutput, spaceW);
|
||||
|
||||
/* Format the time */
|
||||
FileTimeToSystemTime(&fileInfo.ftLastWriteTime, &systime);
|
||||
GetDateFormatW(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &systime,
|
||||
NULL, thisoutput, MAX_PATH);
|
||||
strcatW(thisoutput, space);
|
||||
strcatW(thisoutput, spaceW);
|
||||
datelen = strlenW(thisoutput);
|
||||
GetTimeFormatW(LOCALE_USER_DEFAULT, TIME_NOSECONDS, &systime,
|
||||
NULL, (thisoutput+datelen), MAX_PATH-datelen);
|
||||
|
@ -497,14 +497,14 @@ void WCMD_HandleTildaModifiers(WCHAR **start, const WCHAR *forVariable,
|
|||
static const WCHAR fmt[] = {'%','u','\0'};
|
||||
|
||||
doneModifier = TRUE;
|
||||
if (finaloutput[0] != 0x00) strcatW(finaloutput, space);
|
||||
if (finaloutput[0] != 0x00) strcatW(finaloutput, spaceW);
|
||||
wsprintfW(thisoutput, fmt, fullsize);
|
||||
strcatW(finaloutput, thisoutput);
|
||||
}
|
||||
|
||||
/* 4. Handle 's' : Use short paths (File doesn't have to exist) */
|
||||
if (memchrW(firstModifier, 's', modifierLen) != NULL) {
|
||||
if (finaloutput[0] != 0x00) strcatW(finaloutput, space);
|
||||
if (finaloutput[0] != 0x00) strcatW(finaloutput, spaceW);
|
||||
/* Don't flag as doneModifier - %~s on its own is processed later */
|
||||
GetShortPathNameW(outputparam, outputparam, sizeof(outputparam)/sizeof(outputparam[0]));
|
||||
}
|
||||
|
@ -513,7 +513,7 @@ void WCMD_HandleTildaModifiers(WCHAR **start, const WCHAR *forVariable,
|
|||
/* Note this overrides d,p,n,x */
|
||||
if (memchrW(firstModifier, 'f', modifierLen) != NULL) {
|
||||
doneModifier = TRUE;
|
||||
if (finaloutput[0] != 0x00) strcatW(finaloutput, space);
|
||||
if (finaloutput[0] != 0x00) strcatW(finaloutput, spaceW);
|
||||
strcatW(finaloutput, fullfilename);
|
||||
} else {
|
||||
|
||||
|
@ -523,7 +523,7 @@ void WCMD_HandleTildaModifiers(WCHAR **start, const WCHAR *forVariable,
|
|||
WCHAR ext[MAX_PATH];
|
||||
BOOL doneFileModifier = FALSE;
|
||||
|
||||
if (finaloutput[0] != 0x00) strcatW(finaloutput, space);
|
||||
if (finaloutput[0] != 0x00) strcatW(finaloutput, spaceW);
|
||||
|
||||
/* Split into components */
|
||||
WCMD_splitpath(fullfilename, drive, dir, fname, ext);
|
||||
|
@ -560,7 +560,7 @@ void WCMD_HandleTildaModifiers(WCHAR **start, const WCHAR *forVariable,
|
|||
if (!doneFileModifier &&
|
||||
memchrW(firstModifier, 's', modifierLen) != NULL) {
|
||||
doneModifier = TRUE;
|
||||
if (finaloutput[0] != 0x00) strcatW(finaloutput, space);
|
||||
if (finaloutput[0] != 0x00) strcatW(finaloutput, spaceW);
|
||||
strcatW(finaloutput, outputparam);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -349,7 +349,7 @@ void WCMD_choice (const WCHAR * command) {
|
|||
ptr = strchrW(opt_c, answer[0]);
|
||||
if (ptr) {
|
||||
WCMD_output_asis(answer);
|
||||
WCMD_output_asis(newline);
|
||||
WCMD_output_asis(newlineW);
|
||||
if (have_console)
|
||||
SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), oldmode);
|
||||
|
||||
|
@ -954,7 +954,7 @@ void WCMD_echo (const WCHAR *command)
|
|||
echo_mode = FALSE;
|
||||
else {
|
||||
WCMD_output_asis (command);
|
||||
WCMD_output_asis (newline);
|
||||
WCMD_output_asis (newlineW);
|
||||
}
|
||||
HeapFree(GetProcessHeap(), 0, trimmed);
|
||||
}
|
||||
|
@ -2101,7 +2101,7 @@ void WCMD_setshow_default (const WCHAR *command) {
|
|||
|
||||
GetCurrentDirectoryW(sizeof(cwd)/sizeof(WCHAR), cwd);
|
||||
if (strlenW(command) == 0) {
|
||||
strcatW (cwd, newline);
|
||||
strcatW (cwd, newlineW);
|
||||
WCMD_output_asis (cwd);
|
||||
}
|
||||
else {
|
||||
|
@ -2264,7 +2264,7 @@ static int WCMD_setshow_sortenv(const WCHAR *s, const WCHAR *stub)
|
|||
/* Don't display special internal variables */
|
||||
if (str[i][0] != '=') {
|
||||
WCMD_output_asis(str[i]);
|
||||
WCMD_output_asis(newline);
|
||||
WCMD_output_asis(newlineW);
|
||||
displayedcount++;
|
||||
}
|
||||
}
|
||||
|
@ -2368,7 +2368,7 @@ void WCMD_setshow_path (const WCHAR *command) {
|
|||
if (status != 0) {
|
||||
WCMD_output_asis ( pathEqW);
|
||||
WCMD_output_asis ( string);
|
||||
WCMD_output_asis ( newline);
|
||||
WCMD_output_asis ( newlineW);
|
||||
}
|
||||
else {
|
||||
WCMD_output_stderr(WCMD_LoadMessage(WCMD_NOPATH));
|
||||
|
@ -2488,7 +2488,7 @@ void WCMD_start(const WCHAR *command)
|
|||
strcatW( file, exeW );
|
||||
cmdline = HeapAlloc( GetProcessHeap(), 0, (strlenW(file) + strlenW(command) + 2) * sizeof(WCHAR) );
|
||||
strcpyW( cmdline, file );
|
||||
strcatW( cmdline, space );
|
||||
strcatW( cmdline, spaceW );
|
||||
strcatW( cmdline, command );
|
||||
|
||||
memset( &st, 0, sizeof(STARTUPINFOW) );
|
||||
|
@ -2879,7 +2879,7 @@ void WCMD_assoc (const WCHAR *command, BOOL assoc) {
|
|||
if (rc == ERROR_SUCCESS) {
|
||||
WCMD_output_asis(keyValue);
|
||||
}
|
||||
WCMD_output_asis(newline);
|
||||
WCMD_output_asis(newlineW);
|
||||
RegCloseKey(readKey);
|
||||
}
|
||||
}
|
||||
|
@ -2909,7 +2909,7 @@ void WCMD_assoc (const WCHAR *command, BOOL assoc) {
|
|||
WCMD_output_asis(equalW);
|
||||
/* If no default value found, leave line empty after '=' */
|
||||
if (rc == ERROR_SUCCESS) WCMD_output_asis(keyValue);
|
||||
WCMD_output_asis(newline);
|
||||
WCMD_output_asis(newlineW);
|
||||
RegCloseKey(readKey);
|
||||
|
||||
} else {
|
||||
|
@ -2982,7 +2982,7 @@ void WCMD_assoc (const WCHAR *command, BOOL assoc) {
|
|||
WCMD_output_asis(command);
|
||||
WCMD_output_asis(equalW);
|
||||
WCMD_output_asis(newValue);
|
||||
WCMD_output_asis(newline);
|
||||
WCMD_output_asis(newlineW);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -316,7 +316,7 @@ static DIRECTORY_STACK *WCMD_list_directory (DIRECTORY_STACK *inputparms, int le
|
|||
|
||||
/* Output the results */
|
||||
if (!bare) {
|
||||
if (level != 0 && (entry_count > 0)) WCMD_output_asis (newline);
|
||||
if (level != 0 && (entry_count > 0)) WCMD_output_asis (newlineW);
|
||||
if (!recurse || ((entry_count > 0) && done_header==FALSE)) {
|
||||
static const WCHAR headerW[] = {'D','i','r','e','c','t','o','r','y',' ','o','f',
|
||||
' ','%','1','\n','\n','\0'};
|
||||
|
@ -446,7 +446,7 @@ static DIRECTORY_STACK *WCMD_list_directory (DIRECTORY_STACK *inputparms, int le
|
|||
}
|
||||
}
|
||||
}
|
||||
if (addNewLine) WCMD_output_asis (newline);
|
||||
if (addNewLine) WCMD_output_asis (newlineW);
|
||||
cur_width = 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -231,8 +231,8 @@ extern BATCH_CONTEXT *context;
|
|||
#define WCMD_EXIT 45
|
||||
|
||||
/* Some standard messages */
|
||||
extern const WCHAR newline[];
|
||||
extern const WCHAR space[];
|
||||
extern const WCHAR newlineW[];
|
||||
extern const WCHAR spaceW[];
|
||||
extern const WCHAR nullW[];
|
||||
extern const WCHAR dotW[];
|
||||
extern const WCHAR dotdotW[];
|
||||
|
|
|
@ -44,8 +44,8 @@ int defaultColor = 7;
|
|||
BOOL echo_mode = TRUE;
|
||||
|
||||
WCHAR anykey[100], version_string[100];
|
||||
const WCHAR newline[] = {'\r','\n','\0'};
|
||||
const WCHAR space[] = {' ','\0'};
|
||||
const WCHAR newlineW[] = {'\r','\n','\0'};
|
||||
const WCHAR spaceW[] = {' ','\0'};
|
||||
|
||||
static BOOL opt_c, opt_k, opt_s, unicodeOutput = FALSE;
|
||||
|
||||
|
@ -318,7 +318,7 @@ void WCMD_print_error (void) {
|
|||
WCMD_output_asis_len(lpMsgBuf, lstrlenW(lpMsgBuf),
|
||||
GetStdHandle(STD_ERROR_HANDLE));
|
||||
LocalFree (lpMsgBuf);
|
||||
WCMD_output_asis_len (newline, lstrlenW(newline),
|
||||
WCMD_output_asis_len (newlineW, lstrlenW(newlineW),
|
||||
GetStdHandle(STD_ERROR_HANDLE));
|
||||
return;
|
||||
}
|
||||
|
@ -1550,7 +1550,7 @@ void WCMD_execute (const WCHAR *command, const WCHAR *redirects,
|
|||
WCMD_type (p);
|
||||
break;
|
||||
case WCMD_VER:
|
||||
WCMD_output_asis(newline);
|
||||
WCMD_output_asis(newlineW);
|
||||
WCMD_version ();
|
||||
break;
|
||||
case WCMD_VERIFY:
|
||||
|
@ -1813,7 +1813,7 @@ WCHAR *WCMD_ReadAndParseLine(const WCHAR *optionalcmd, CMD_LIST **output, HANDLE
|
|||
if (strlenW(extraSpace) == MAXSTRING -1) {
|
||||
WCMD_output_asis_stderr(WCMD_LoadMessage(WCMD_TRUNCATEDLINE));
|
||||
WCMD_output_asis_stderr(extraSpace);
|
||||
WCMD_output_asis_stderr(newline);
|
||||
WCMD_output_asis_stderr(newlineW);
|
||||
}
|
||||
|
||||
/* Replace env vars if in a batch context */
|
||||
|
@ -1834,9 +1834,9 @@ WCHAR *WCMD_ReadAndParseLine(const WCHAR *optionalcmd, CMD_LIST **output, HANDLE
|
|||
&& CompareStringW(LOCALE_SYSTEM_DEFAULT, NORM_IGNORECASE,
|
||||
extraSpace, min_len, echoCol, len) != CSTR_EQUAL)
|
||||
{
|
||||
WCMD_output_asis(space);
|
||||
WCMD_output_asis(spaceW);
|
||||
}
|
||||
WCMD_output_asis(newline);
|
||||
WCMD_output_asis(newlineW);
|
||||
}
|
||||
|
||||
/* Start with an empty string, copying to the command string */
|
||||
|
@ -2172,7 +2172,7 @@ WCHAR *WCMD_ReadAndParseLine(const WCHAR *optionalcmd, CMD_LIST **output, HANDLE
|
|||
/* Continue to echo commands IF echo is on and in batch program */
|
||||
if (context && echo_mode && extraSpace[0] && (extraSpace[0] != '@')) {
|
||||
WCMD_output_asis(extraSpace);
|
||||
WCMD_output_asis(newline);
|
||||
WCMD_output_asis(newlineW);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue