mirror of
https://github.com/reactos/reactos.git
synced 2025-06-05 17:30:32 +00:00
Fixed minor bugs and removed fixed start directory
svn path=/trunk/; revision=988
This commit is contained in:
parent
6708f0b87e
commit
6bea08705e
2 changed files with 10 additions and 17 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: cmd.c,v 1.18 1999/12/28 23:06:21 ekohl Exp $
|
/* $Id: cmd.c,v 1.19 2000/02/18 00:53:11 ekohl Exp $
|
||||||
*
|
*
|
||||||
* CMD.C - command-line interface.
|
* CMD.C - command-line interface.
|
||||||
*
|
*
|
||||||
|
@ -1170,13 +1170,7 @@ int main (int argc, char *argv[])
|
||||||
INT nExitCode;
|
INT nExitCode;
|
||||||
|
|
||||||
AllocConsole ();
|
AllocConsole ();
|
||||||
#ifndef __REACTOS__
|
|
||||||
SetFileApisToOEM ();
|
SetFileApisToOEM ();
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __REACTOS__
|
|
||||||
SetCurrentDirectory (_T("C:\\"));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* check switches on command-line */
|
/* check switches on command-line */
|
||||||
Initialize (argc, argv);
|
Initialize (argc, argv);
|
||||||
|
|
|
@ -51,6 +51,7 @@
|
||||||
#include <tchar.h>
|
#include <tchar.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
#include "cmd.h"
|
#include "cmd.h"
|
||||||
|
|
||||||
|
@ -81,8 +82,8 @@ VOID CleanHistory(VOID);
|
||||||
VOID History_del_current_entry(LPTSTR str);
|
VOID History_del_current_entry(LPTSTR str);
|
||||||
|
|
||||||
/*service functions*/
|
/*service functions*/
|
||||||
VOID del(LPHIST_ENTRY item);
|
static VOID del(LPHIST_ENTRY item);
|
||||||
VOID add_at_bottom(LPTSTR string);
|
static VOID add_at_bottom(LPTSTR string);
|
||||||
/*VOID add_before_last(LPTSTR string);*/
|
/*VOID add_before_last(LPTSTR string);*/
|
||||||
VOID set_size(INT new_size);
|
VOID set_size(INT new_size);
|
||||||
|
|
||||||
|
@ -95,8 +96,6 @@ INT CommandHistory (LPTSTR cmd, LPTSTR param)
|
||||||
LPHIST_ENTRY h_tmp;
|
LPHIST_ENTRY h_tmp;
|
||||||
TCHAR szBuffer[2048];
|
TCHAR szBuffer[2048];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
tmp=_tcschr(param,_T('/'));
|
tmp=_tcschr(param,_T('/'));
|
||||||
|
|
||||||
if (tmp)
|
if (tmp)
|
||||||
|
@ -107,6 +106,7 @@ INT CommandHistory (LPTSTR cmd, LPTSTR param)
|
||||||
case _T('F'):/*delete history*/
|
case _T('F'):/*delete history*/
|
||||||
CleanHistory();InitHistory();
|
CleanHistory();InitHistory();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case _T('R'):/*read history from standard in*/
|
case _T('R'):/*read history from standard in*/
|
||||||
//hIn=GetStdHandle (STD_INPUT_HANDLE);
|
//hIn=GetStdHandle (STD_INPUT_HANDLE);
|
||||||
|
|
||||||
|
@ -117,19 +117,18 @@ INT CommandHistory (LPTSTR cmd, LPTSTR param)
|
||||||
History(0,szBuffer);
|
History(0,szBuffer);
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case _T('A'):/*add an antry*/
|
case _T('A'):/*add an antry*/
|
||||||
History(0,param+2);
|
History(0,param+2);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case _T('S'):/*set history size*/
|
case _T('S'):/*set history size*/
|
||||||
if (tmp_int=_ttoi(param+2))
|
if ((tmp_int=_ttoi(param+2)))
|
||||||
set_size(tmp_int);
|
set_size(tmp_int);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -139,7 +138,7 @@ INT CommandHistory (LPTSTR cmd, LPTSTR param)
|
||||||
for(h_tmp=Top->prev;h_tmp!=Bottom;h_tmp=h_tmp->prev)
|
for(h_tmp=Top->prev;h_tmp!=Bottom;h_tmp=h_tmp->prev)
|
||||||
ConErrPuts(h_tmp->string);
|
ConErrPuts(h_tmp->string);
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID set_size(INT new_size)
|
VOID set_size(INT new_size)
|
||||||
|
|
Loading…
Reference in a new issue