cmd: Use BOOL instead of int for boolean variables.

This commit is contained in:
Frédéric Delanoy 2012-03-29 18:05:59 +02:00 committed by Alexandre Julliard
parent 5b56d06074
commit 0e4ceb9a8d
4 changed files with 18 additions and 19 deletions

View File

@ -40,8 +40,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(cmd);
* a label to goto once opened.
*/
void WCMD_batch (WCHAR *file, WCHAR *command, int called, WCHAR *startLabel, HANDLE pgmHandle) {
void WCMD_batch (WCHAR *file, WCHAR *command, BOOL called, WCHAR *startLabel, HANDLE pgmHandle)
{
HANDLE h = INVALID_HANDLE_VALUE;
BATCH_CONTEXT *prev_context;
@ -583,7 +583,7 @@ void WCMD_call (WCHAR *command) {
/* Run other program if no leading ':' */
if (*command != ':') {
WCMD_run_program(command, 1);
WCMD_run_program(command, TRUE);
} else {
WCHAR gotoLabel[MAX_PATH];
@ -600,7 +600,7 @@ void WCMD_call (WCHAR *command) {
li.u.LowPart = SetFilePointer(context -> h, li.u.LowPart,
&li.u.HighPart, FILE_CURRENT);
WCMD_batch (param1, command, 1, gotoLabel, context->h);
WCMD_batch (param1, command, TRUE, gotoLabel, context->h);
SetFilePointer(context -> h, li.u.LowPart,
&li.u.HighPart, FILE_BEGIN);

View File

@ -1416,7 +1416,7 @@ void WCMD_give_help (const WCHAR *command)
static const WCHAR helpW[] = {' ', '/','?','\0'};
strcpyW(cmd, command);
strcatW(cmd, helpW);
WCMD_run_program(cmd, 0);
WCMD_run_program(cmd, FALSE);
return;
}
}

View File

@ -54,7 +54,7 @@ typedef struct _CMD_LIST {
} CMD_LIST;
void WCMD_assoc (const WCHAR *, BOOL);
void WCMD_batch (WCHAR *, WCHAR *, int, WCHAR *, HANDLE);
void WCMD_batch (WCHAR *, WCHAR *, BOOL, WCHAR *, HANDLE);
void WCMD_call (WCHAR *command);
void WCMD_change_tty (void);
void WCMD_choice (const WCHAR *);
@ -86,7 +86,7 @@ void WCMD_print_error (void);
void WCMD_pushd (const WCHAR *command);
void WCMD_remove_dir (WCHAR *command);
void WCMD_rename (void);
void WCMD_run_program (WCHAR *command, int called);
void WCMD_run_program (WCHAR *command, BOOL called);
void WCMD_setlocal (const WCHAR *command);
void WCMD_setshow_date (void);
void WCMD_setshow_default (const WCHAR *command);

View File

@ -993,8 +993,8 @@ static void init_msvcrt_io_block(STARTUPINFOW* st)
* findexecutable to achieve this which is left untouched.
*/
void WCMD_run_program (WCHAR *command, int called) {
void WCMD_run_program (WCHAR *command, BOOL called)
{
WCHAR temp[MAX_PATH];
WCHAR pathtosearch[MAXSTRING];
WCHAR *pathposn;
@ -1585,7 +1585,7 @@ void WCMD_execute (const WCHAR *command, const WCHAR *redirects,
break;
default:
prev_echo_mode = echo_mode;
WCMD_run_program (whichcmd, 0);
WCMD_run_program (whichcmd, FALSE);
echo_mode = prev_echo_mode;
}
HeapFree( GetProcessHeap(), 0, cmd );
@ -2336,19 +2336,19 @@ int wmain (int argc, WCHAR *argvW[])
argsLeft = args;
for (arg = argvW; argsLeft>0; arg++,argsLeft--)
{
int has_space,bcount;
BOOL has_space = FALSE;
int bcount;
WCHAR* a;
has_space=0;
bcount=0;
a=*arg;
if( !*a ) has_space=1;
if( !*a ) has_space = TRUE;
while (*a!='\0') {
if (*a=='\\') {
bcount++;
} else {
if (*a==' ' || *a=='\t') {
has_space=1;
has_space = TRUE;
} else if (*a=='"') {
/* doubling of '\' preceding a '"',
* plus escaping of said '"'
@ -2395,20 +2395,19 @@ int wmain (int argc, WCHAR *argvW[])
argsLeft = args;
for (arg = argvW; argsLeft>0; arg++,argsLeft--)
{
int has_space,has_quote;
BOOL has_space = FALSE, has_quote = FALSE;
WCHAR* a;
/* Check for quotes and spaces in this argument */
has_space=has_quote=0;
a=*arg;
if( !*a ) has_space=1;
if( !*a ) has_space = TRUE;
while (*a!='\0') {
if (*a==' ' || *a=='\t') {
has_space=1;
has_space = TRUE;
if (has_quote)
break;
} else if (*a=='"') {
has_quote=1;
has_quote = TRUE;
if (has_space)
break;
}