cmd: Fix silly local variables indentation that breaks diff -p.

This commit is contained in:
Alexandre Julliard 2007-03-01 12:43:19 +01:00
parent f6ec44173f
commit abfe105c2f
4 changed files with 104 additions and 104 deletions

View File

@ -45,12 +45,12 @@ void WCMD_batch (char *file, char *command, int called, char *startLabel, HANDLE
#define WCMD_BATCH_EXT_SIZE 5
HANDLE h = INVALID_HANDLE_VALUE;
char string[MAXSTRING];
char extension_batch[][WCMD_BATCH_EXT_SIZE] = {".bat",".cmd"};
char extension_exe[WCMD_BATCH_EXT_SIZE] = ".exe";
unsigned int i;
BATCH_CONTEXT *prev_context;
HANDLE h = INVALID_HANDLE_VALUE;
char string[MAXSTRING];
char extension_batch[][WCMD_BATCH_EXT_SIZE] = {".bat",".cmd"};
char extension_exe[WCMD_BATCH_EXT_SIZE] = ".exe";
unsigned int i;
BATCH_CONTEXT *prev_context;
if (startLabel == NULL) {
for(i=0; (i<(sizeof(extension_batch)/WCMD_BATCH_EXT_SIZE)) &&
@ -143,9 +143,9 @@ BATCH_CONTEXT *prev_context;
char *WCMD_parameter (char *s, int n, char **where) {
int i = 0;
static char param[MAX_PATH];
char *p;
int i = 0;
static char param[MAX_PATH];
char *p;
if (where != NULL) *where = NULL;
p = param;
@ -213,9 +213,9 @@ char *p;
char *WCMD_fgets (char *s, int n, HANDLE h) {
DWORD bytes;
BOOL status;
char *p;
DWORD bytes;
BOOL status;
char *p;
p = s;
do {

View File

@ -105,13 +105,13 @@ void WCMD_change_tty (void) {
void WCMD_copy (void) {
DWORD count;
WIN32_FIND_DATA fd;
HANDLE hff;
BOOL force, status;
static const char overwrite[] = "Overwrite file (Y/N)?";
char string[8], outpath[MAX_PATH], inpath[MAX_PATH], *infile, copycmd[3];
DWORD len;
DWORD count;
WIN32_FIND_DATA fd;
HANDLE hff;
BOOL force, status;
static const char overwrite[] = "Overwrite file (Y/N)?";
char string[8], outpath[MAX_PATH], inpath[MAX_PATH], *infile, copycmd[3];
DWORD len;
if (param1[0] == 0x00) {
WCMD_output ("Argument missing\n");
@ -244,10 +244,10 @@ void WCMD_create_dir (void) {
void WCMD_delete (int recurse) {
WIN32_FIND_DATA fd;
HANDLE hff;
char fpath[MAX_PATH];
char *p;
WIN32_FIND_DATA fd;
HANDLE hff;
char fpath[MAX_PATH];
char *p;
if (param1[0] == 0x00) {
WCMD_output ("Argument missing\n");
@ -403,8 +403,8 @@ char *p;
void WCMD_echo (const char *command) {
static const char eon[] = "Echo is ON\n", eoff[] = "Echo is OFF\n";
int count;
static const char eon[] = "Echo is ON\n", eoff[] = "Echo is OFF\n";
int count;
if ((command[0] == '.') && (command[1] == 0)) {
WCMD_output (newline);
@ -441,11 +441,11 @@ int count;
void WCMD_for (char *p) {
WIN32_FIND_DATA fd;
HANDLE hff;
char *cmd, *item;
char set[MAX_PATH], param[MAX_PATH];
int i;
WIN32_FIND_DATA fd;
HANDLE hff;
char *cmd, *item;
char set[MAX_PATH], param[MAX_PATH];
int i;
if (lstrcmpi (WCMD_parameter (p, 1, NULL), "in")
|| lstrcmpi (WCMD_parameter (p, 3, NULL), "do")
@ -489,8 +489,8 @@ int i;
void WCMD_execute (char *orig_cmd, char *param, char *subst) {
char *new_cmd, *p, *s, *dup;
int size;
char *new_cmd, *p, *s, *dup;
int size;
size = lstrlen (orig_cmd);
new_cmd = (char *) LocalAlloc (LMEM_FIXED | LMEM_ZEROINIT, size);
@ -519,8 +519,8 @@ int size;
void WCMD_give_help (char *command) {
int i;
char buffer[2048];
int i;
char buffer[2048];
command = WCMD_strtrim_leading_spaces(command);
if (lstrlen(command) == 0) {
@ -552,7 +552,7 @@ char buffer[2048];
void WCMD_goto (void) {
char string[MAX_PATH];
char string[MAX_PATH];
if (param1[0] == 0x00) {
WCMD_output ("Argument missing\n");
@ -642,13 +642,13 @@ void WCMD_popd (void) {
void WCMD_if (char *p) {
int negate = 0, test = 0;
char condition[MAX_PATH], *command, *s;
int negate = 0, test = 0;
char condition[MAX_PATH], *command, *s;
if (!lstrcmpi (param1, "not")) {
negate = 1;
lstrcpy (condition, param2);
}
}
else {
lstrcpy (condition, param1);
}
@ -693,10 +693,10 @@ char condition[MAX_PATH], *command, *s;
void WCMD_move (void) {
int status;
char outpath[MAX_PATH], inpath[MAX_PATH], *infile;
WIN32_FIND_DATA fd;
HANDLE hff;
int status;
char outpath[MAX_PATH], inpath[MAX_PATH], *infile;
WIN32_FIND_DATA fd;
HANDLE hff;
if (param1[0] == 0x00) {
WCMD_output ("Argument missing\n");
@ -739,8 +739,8 @@ HANDLE hff;
void WCMD_pause (void) {
DWORD count;
char string[32];
DWORD count;
char string[32];
WCMD_output (anykey);
ReadFile (GetStdHandle(STD_INPUT_HANDLE), string, sizeof(string), &count, NULL);
@ -801,7 +801,7 @@ void WCMD_remove_dir (void) {
void WCMD_rename (void) {
int status;
int status;
if (param1[0] == 0x00 || param2[0] == 0x00) {
WCMD_output ("Argument missing\n");
@ -957,10 +957,10 @@ void WCMD_endlocal (void) {
void WCMD_setshow_attrib (void) {
DWORD count;
HANDLE hff;
WIN32_FIND_DATA fd;
char flags[9] = {" "};
DWORD count;
HANDLE hff;
WIN32_FIND_DATA fd;
char flags[9] = {" "};
if (param1[0] == '-') {
WCMD_output (nyi);
@ -1013,8 +1013,8 @@ char flags[9] = {" "};
void WCMD_setshow_default (void) {
BOOL status;
char string[1024];
BOOL status;
char string[1024];
if (strlen(param1) == 0) {
GetCurrentDirectory (sizeof(string), string);
@ -1040,8 +1040,8 @@ char string[1024];
void WCMD_setshow_date (void) {
char curdate[64], buffer[64];
DWORD count;
char curdate[64], buffer[64];
DWORD count;
if (lstrlen(param1) == 0) {
if (GetDateFormat (LOCALE_USER_DEFAULT, 0, NULL, NULL,
@ -1127,9 +1127,9 @@ static int WCMD_setshow_sortenv(const char *s, const char *stub)
void WCMD_setshow_env (char *s) {
LPVOID env;
char *p;
int status;
LPVOID env;
char *p;
int status;
if (strlen(param1) == 0) {
env = GetEnvironmentStrings ();
@ -1160,8 +1160,8 @@ int status;
void WCMD_setshow_path (char *command) {
char string[1024];
DWORD status;
char string[1024];
DWORD status;
if (strlen(param1) == 0) {
status = GetEnvironmentVariable ("PATH", string, sizeof(string));
@ -1189,7 +1189,7 @@ DWORD status;
void WCMD_setshow_prompt (void) {
char *s;
char *s;
if (strlen(param1) == 0) {
SetEnvironmentVariable ("PROMPT", NULL);
@ -1213,9 +1213,9 @@ char *s;
void WCMD_setshow_time (void) {
char curtime[64], buffer[64];
DWORD count;
SYSTEMTIME st;
char curtime[64], buffer[64];
DWORD count;
SYSTEMTIME st;
if (strlen(param1) == 0) {
GetLocalTime(&st);
@ -1263,9 +1263,9 @@ void WCMD_title (char *command) {
void WCMD_type (void) {
HANDLE h;
char buffer[512];
DWORD count;
HANDLE h;
char buffer[512];
DWORD count;
if (param1[0] == 0x00) {
WCMD_output ("Argument missing\n");
@ -1295,8 +1295,8 @@ DWORD count;
void WCMD_verify (char *command) {
static const char von[] = "Verify is ON\n", voff[] = "Verify is OFF\n";
int count;
static const char von[] = "Verify is ON\n", voff[] = "Verify is OFF\n";
int count;
count = strlen(command);
if (count == 0) {
@ -1335,9 +1335,9 @@ void WCMD_version (void) {
int WCMD_volume (int mode, char *path) {
DWORD count, serial;
char string[MAX_PATH], label[MAX_PATH], curdir[MAX_PATH];
BOOL status;
DWORD count, serial;
char string[MAX_PATH], label[MAX_PATH], curdir[MAX_PATH];
BOOL status;
if (lstrlen(path) == 0) {
status = GetCurrentDirectory (sizeof(curdir), curdir);

View File

@ -53,10 +53,10 @@ static ULONGLONG byte_total;
void WCMD_directory (void) {
char path[MAX_PATH], drive[8];
int status, paged_mode;
ULARGE_INTEGER avail, total, free;
CONSOLE_SCREEN_BUFFER_INFO consoleInfo;
char path[MAX_PATH], drive[8];
int status, paged_mode;
ULARGE_INTEGER avail, total, free;
CONSOLE_SCREEN_BUFFER_INFO consoleInfo;
byte_total = 0;
file_total = dir_total = 0;
@ -128,15 +128,15 @@ CONSOLE_SCREEN_BUFFER_INFO consoleInfo;
void WCMD_list_directory (char *search_path, int level) {
char string[1024], datestring[32], timestring[32];
char *p;
char real_path[MAX_PATH];
WIN32_FIND_DATA *fd;
FILETIME ft;
SYSTEMTIME st;
HANDLE hff;
int status, dir_count, file_count, entry_count, i, widest, cur_width, tmp_width;
ULARGE_INTEGER byte_count, file_size;
char string[1024], datestring[32], timestring[32];
char *p;
char real_path[MAX_PATH];
WIN32_FIND_DATA *fd;
FILETIME ft;
SYSTEMTIME st;
HANDLE hff;
int status, dir_count, file_count, entry_count, i, widest, cur_width, tmp_width;
ULARGE_INTEGER byte_count, file_size;
dir_count = 0;
file_count = 0;
@ -323,10 +323,10 @@ ULARGE_INTEGER byte_count, file_size;
char * WCMD_filesize64 (ULONGLONG n) {
ULONGLONG q;
unsigned int r, i;
char *p;
static char buff[32];
ULONGLONG q;
unsigned int r, i;
char *p;
static char buff[32];
p = buff;
i = -3;
@ -350,8 +350,8 @@ static char buff[32];
char * WCMD_strrev (char *buff) {
int r, i;
char b;
int r, i;
char b;
r = lstrlen (buff);
for (i=0; i<r/2; i++) {

View File

@ -855,10 +855,10 @@ void WCMD_run_program (char *command, int called) {
void WCMD_show_prompt (void) {
int status;
char out_string[MAX_PATH], curdir[MAX_PATH], prompt_string[MAX_PATH];
char *p, *q;
DWORD len;
int status;
char out_string[MAX_PATH], curdir[MAX_PATH], prompt_string[MAX_PATH];
char *p, *q;
DWORD len;
len = GetEnvironmentVariable ("PROMPT", prompt_string, sizeof(prompt_string));
if ((len == 0) || (len >= sizeof(prompt_string))) {
@ -936,9 +936,9 @@ DWORD len;
*/
void WCMD_print_error (void) {
LPVOID lpMsgBuf;
DWORD error_code;
int status;
LPVOID lpMsgBuf;
DWORD error_code;
int status;
error_code = GetLastError ();
status = FormatMessage (FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
@ -1015,9 +1015,9 @@ int p = 0;
void WCMD_output (const char *format, ...) {
va_list ap;
char string[1024];
int ret;
va_list ap;
char string[1024];
int ret;
va_start(ap,format);
ret = vsnprintf (string, sizeof( string), format, ap);
@ -1036,7 +1036,7 @@ static BOOL paged_mode;
void WCMD_enter_paged_mode(void)
{
CONSOLE_SCREEN_BUFFER_INFO consoleInfo;
CONSOLE_SCREEN_BUFFER_INFO consoleInfo;
if (GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &consoleInfo))
max_height = consoleInfo.dwSize.Y;
@ -1089,7 +1089,7 @@ void WCMD_output_asis (const char *message) {
char *WCMD_strtrim_leading_spaces (char *string) {
char *ptr;
char *ptr;
ptr = string;
while (*ptr == ' ') ptr++;
@ -1105,7 +1105,7 @@ char *ptr;
void WCMD_strtrim_trailing_spaces (char *string) {
char *ptr;
char *ptr;
ptr = string + lstrlen (string) - 1;
while ((*ptr == ' ') && (ptr >= string)) {
@ -1142,8 +1142,8 @@ void WCMD_opt_s_strip_quotes(char *cmd) {
void WCMD_pipe (char *command) {
char *p;
char temp_path[MAX_PATH], temp_file[MAX_PATH], temp_file2[MAX_PATH], temp_cmd[1024];
char *p;
char temp_path[MAX_PATH], temp_file[MAX_PATH], temp_file2[MAX_PATH], temp_cmd[1024];
GetTempPath (sizeof(temp_path), temp_path);
GetTempFileName (temp_path, "CMD", 0, temp_file);