several changes to make cmd compile and link again

svn path=/trunk/; revision=384
This commit is contained in:
Eric Kohl 1999-04-14 23:48:27 +00:00
parent ebb6fcbc30
commit 731f19e9b1
20 changed files with 94 additions and 50 deletions

View file

@ -112,6 +112,7 @@
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdio.h>
#include "cmd.h"
#include "batch.h"
@ -199,7 +200,7 @@ Execute (LPTSTR first, LPTSTR rest)
TCHAR szFullCmdLine [1024];
PROCESS_INFORMATION prci;
STARTUPINFO stui;
DWORD dwError = 0;
// DWORD dwError = 0;
#ifdef _DEBUG
DebugPrintf ("[EXEC: %s %s]\n", szFullName, rest);
@ -697,7 +698,7 @@ ProcessInput (BOOL bFlag)
break;
case _T('?'):
cp += wsprintf (cp, _T("%u"), nErrorLevel);
cp += _stprintf (cp, _T("%u"), nErrorLevel);
ip++;
break;
@ -931,8 +932,10 @@ static VOID Initialize (int argc, char *argv[])
ShowCommands ();
/* Set COMSPEC environment variable */
#ifndef __REACTOS__
if (argv)
SetEnvironmentVariable (_T("COMSPEC"), argv[0]);
#endif
/* add ctrl handler */
#if 0
@ -972,6 +975,10 @@ int main (int argc, char *argv[])
SetFileApisToOEM ();
#endif
#ifdef __REACTOS__
SetCurrentDirectory (_T("C:\\"));
#endif
/* check switches on command-line */
Initialize (argc, argv);
@ -983,4 +990,5 @@ int main (int argc, char *argv[])
FreeConsole ();
return nExitCode;
// return 0;
}

View file

@ -65,6 +65,8 @@
#define D_OFF "off"
#define CHECKPOINT ConErrPrintf("%s:%d\n",__FILE__,__LINE__);
/* Prototypes for CMD.C */
extern HANDLE hOut;

View file

@ -20,7 +20,7 @@
/* JPP 20 Jul 1998 - define DEBUG to add debugging code */
/*#define DEBUG */
#define DEBUG
/* Define to enable the alias command, and aliases.*/

View file

@ -37,7 +37,8 @@ VOID DebugPrintf (LPTSTR szFormat, ...)
_vstprintf (szOut, szFormat, arg_ptr);
va_end (arg_ptr);
OutputDebugString (szOut);
WriteFile (GetStdHandle (STD_OUTPUT_HANDLE), szOut, _tcslen(szOut), &dwWritten, NULL);
// OutputDebugString (szOut);
}
#endif /* _DEBUG */
@ -124,7 +125,8 @@ VOID ConOutPuts (LPTSTR szText)
DWORD dwWritten;
WriteFile (GetStdHandle (STD_OUTPUT_HANDLE), szText, _tcslen(szText), &dwWritten, NULL);
WriteFile (GetStdHandle (STD_OUTPUT_HANDLE), "\x0a\x0d", 2, &dwWritten, NULL);
// WriteFile (GetStdHandle (STD_OUTPUT_HANDLE), "\x0a\x0d", 2, &dwWritten, NULL);
WriteFile (GetStdHandle (STD_OUTPUT_HANDLE), "\n", 1, &dwWritten, NULL);
}
@ -155,7 +157,8 @@ VOID ConErrPuts (LPTSTR szText)
DWORD dwWritten;
WriteFile (GetStdHandle (STD_ERROR_HANDLE), szText, _tcslen(szText), &dwWritten, NULL);
WriteFile (GetStdHandle (STD_ERROR_HANDLE), "\x0a\x0d", 2, &dwWritten, NULL);
// WriteFile (GetStdHandle (STD_ERROR_HANDLE), "\x0a\x0d", 2, &dwWritten, NULL);
WriteFile (GetStdHandle (STD_ERROR_HANDLE), "\n", 1, &dwWritten, NULL);
}
@ -236,5 +239,5 @@ VOID SetCursorType (BOOL bInsert, BOOL bVisible)
cci.dwSize = bInsert ? 10 : 100;
cci.bVisible = bVisible;
SetConsoleCursorInfo (GetStdHandle (STD_OUTPUT_HANDLE), &cci);
// SetConsoleCursorInfo (GetStdHandle (STD_OUTPUT_HANDLE), &cci);
}

View file

@ -205,7 +205,7 @@ AddFiles (LPFILES f, char *arg, int *source, int *dest,
static BOOL
GetDestination (LPFILES f, LPFILES dest)
{
LPFILES p;
LPFILES p = NULL;
LPFILES start = f;
while (f->next != NULL)

View file

@ -36,6 +36,7 @@
#include <tchar.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include "cmd.h"
@ -92,6 +93,7 @@ static BOOL ConfirmDeleteAll (VOID)
}
#if 0
static INT Prompt (LPTSTR str)
{
TCHAR inp[10];
@ -118,7 +120,7 @@ static INT Prompt (LPTSTR str)
return PROMPT_NO;
}
#endif
static BOOL
RemoveFile (LPTSTR lpFileName, DWORD dwFlags)

View file

@ -118,6 +118,7 @@
#include <tchar.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include "cmd.h"
@ -786,17 +787,17 @@ DirList (LPTSTR szPath, LPTSTR szFilespec, LPINT pLine, DWORD dwFlags)
if (file.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
{
if (file.cAlternateFileName[0] == _T('\0'))
wsprintf (buffer, _T("[%s]"), file.cFileName);
_stprintf (buffer, _T("[%s]"), file.cFileName);
else
wsprintf (buffer, _T("[%s]"), file.cAlternateFileName);
_stprintf (buffer, _T("[%s]"), file.cAlternateFileName);
dircount++;
}
else
{
if (file.cAlternateFileName[0] == _T('\0'))
wsprintf (buffer, _T("%s"), file.cFileName);
_stprintf (buffer, _T("%s"), file.cFileName);
else
wsprintf (buffer, _T("%s"), file.cAlternateFileName);
_stprintf (buffer, _T("%s"), file.cAlternateFileName);
filecount++;
}

View file

@ -20,6 +20,7 @@
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdio.h>
#include "cmd.h"
@ -222,7 +223,7 @@ BOOL ShowCompletionMatches (LPTSTR str, INT charcount)
continue;
if (file.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
wsprintf (fname,"[%s]", file.cFileName);
_stprintf (fname, _T("[%s]"), file.cFileName);
else
_tcscpy (fname, file.cFileName);

View file

@ -15,9 +15,14 @@ OBJECTS = ../common/crt0.o cmd.o attrib.o alias.o batch.o beep.o call.o \
pause.o prompt.o redir.o ren.o set.o shift.o time.o title.o type.o \
ver.o verify.o vol.o where.o
LIBS= ../../lib/kernel32/kernel32.a ../../lib/ntdll/ntdll.a
LIBS= ../../lib/kernel32/kernel32.a ../../lib/crtdll/crtdll.a
CLEAN_FILES = $(OBJECTS) cmd.exe cmd.sym
CLEAN_FILES = cmd.o attrib.o alias.o batch.o beep.o call.o \
chcp.o cls.o cmdinput.o cmdtable.o color.o console.o copy.o date.o \
del.o dir.o dirstack.o echo.o error.o filecomp.o for.o goto.o \
history.o if.o internal.o label.o locale.o misc.o move.o path.o \
pause.o prompt.o redir.o ren.o set.o shift.o time.o title.o type.o \
ver.o verify.o vol.o where.o cmd.exe cmd.sym
clean: $(CLEAN_FILES:%=%_clean)

View file

@ -237,7 +237,7 @@ INT cmd_time (LPTSTR cmd, LPTSTR param)
return 0;
}
// force input the next time around.
/* force input the next time around. */
nTimeString == -1;
}
ConErrPuts (_T("Invalid time."));

View file

@ -112,6 +112,7 @@
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdio.h>
#include "cmd.h"
#include "batch.h"
@ -199,7 +200,7 @@ Execute (LPTSTR first, LPTSTR rest)
TCHAR szFullCmdLine [1024];
PROCESS_INFORMATION prci;
STARTUPINFO stui;
DWORD dwError = 0;
// DWORD dwError = 0;
#ifdef _DEBUG
DebugPrintf ("[EXEC: %s %s]\n", szFullName, rest);
@ -697,7 +698,7 @@ ProcessInput (BOOL bFlag)
break;
case _T('?'):
cp += wsprintf (cp, _T("%u"), nErrorLevel);
cp += _stprintf (cp, _T("%u"), nErrorLevel);
ip++;
break;
@ -931,8 +932,10 @@ static VOID Initialize (int argc, char *argv[])
ShowCommands ();
/* Set COMSPEC environment variable */
#ifndef __REACTOS__
if (argv)
SetEnvironmentVariable (_T("COMSPEC"), argv[0]);
#endif
/* add ctrl handler */
#if 0
@ -972,6 +975,10 @@ int main (int argc, char *argv[])
SetFileApisToOEM ();
#endif
#ifdef __REACTOS__
SetCurrentDirectory (_T("C:\\"));
#endif
/* check switches on command-line */
Initialize (argc, argv);
@ -983,4 +990,5 @@ int main (int argc, char *argv[])
FreeConsole ();
return nExitCode;
// return 0;
}

View file

@ -65,6 +65,8 @@
#define D_OFF "off"
#define CHECKPOINT ConErrPrintf("%s:%d\n",__FILE__,__LINE__);
/* Prototypes for CMD.C */
extern HANDLE hOut;

View file

@ -20,7 +20,7 @@
/* JPP 20 Jul 1998 - define DEBUG to add debugging code */
/*#define DEBUG */
#define DEBUG
/* Define to enable the alias command, and aliases.*/

View file

@ -37,7 +37,8 @@ VOID DebugPrintf (LPTSTR szFormat, ...)
_vstprintf (szOut, szFormat, arg_ptr);
va_end (arg_ptr);
OutputDebugString (szOut);
WriteFile (GetStdHandle (STD_OUTPUT_HANDLE), szOut, _tcslen(szOut), &dwWritten, NULL);
// OutputDebugString (szOut);
}
#endif /* _DEBUG */
@ -124,7 +125,8 @@ VOID ConOutPuts (LPTSTR szText)
DWORD dwWritten;
WriteFile (GetStdHandle (STD_OUTPUT_HANDLE), szText, _tcslen(szText), &dwWritten, NULL);
WriteFile (GetStdHandle (STD_OUTPUT_HANDLE), "\x0a\x0d", 2, &dwWritten, NULL);
// WriteFile (GetStdHandle (STD_OUTPUT_HANDLE), "\x0a\x0d", 2, &dwWritten, NULL);
WriteFile (GetStdHandle (STD_OUTPUT_HANDLE), "\n", 1, &dwWritten, NULL);
}
@ -155,7 +157,8 @@ VOID ConErrPuts (LPTSTR szText)
DWORD dwWritten;
WriteFile (GetStdHandle (STD_ERROR_HANDLE), szText, _tcslen(szText), &dwWritten, NULL);
WriteFile (GetStdHandle (STD_ERROR_HANDLE), "\x0a\x0d", 2, &dwWritten, NULL);
// WriteFile (GetStdHandle (STD_ERROR_HANDLE), "\x0a\x0d", 2, &dwWritten, NULL);
WriteFile (GetStdHandle (STD_ERROR_HANDLE), "\n", 1, &dwWritten, NULL);
}
@ -236,5 +239,5 @@ VOID SetCursorType (BOOL bInsert, BOOL bVisible)
cci.dwSize = bInsert ? 10 : 100;
cci.bVisible = bVisible;
SetConsoleCursorInfo (GetStdHandle (STD_OUTPUT_HANDLE), &cci);
// SetConsoleCursorInfo (GetStdHandle (STD_OUTPUT_HANDLE), &cci);
}

View file

@ -205,7 +205,7 @@ AddFiles (LPFILES f, char *arg, int *source, int *dest,
static BOOL
GetDestination (LPFILES f, LPFILES dest)
{
LPFILES p;
LPFILES p = NULL;
LPFILES start = f;
while (f->next != NULL)

View file

@ -36,6 +36,7 @@
#include <tchar.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include "cmd.h"
@ -92,6 +93,7 @@ static BOOL ConfirmDeleteAll (VOID)
}
#if 0
static INT Prompt (LPTSTR str)
{
TCHAR inp[10];
@ -118,7 +120,7 @@ static INT Prompt (LPTSTR str)
return PROMPT_NO;
}
#endif
static BOOL
RemoveFile (LPTSTR lpFileName, DWORD dwFlags)

View file

@ -118,6 +118,7 @@
#include <tchar.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include "cmd.h"
@ -786,17 +787,17 @@ DirList (LPTSTR szPath, LPTSTR szFilespec, LPINT pLine, DWORD dwFlags)
if (file.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
{
if (file.cAlternateFileName[0] == _T('\0'))
wsprintf (buffer, _T("[%s]"), file.cFileName);
_stprintf (buffer, _T("[%s]"), file.cFileName);
else
wsprintf (buffer, _T("[%s]"), file.cAlternateFileName);
_stprintf (buffer, _T("[%s]"), file.cAlternateFileName);
dircount++;
}
else
{
if (file.cAlternateFileName[0] == _T('\0'))
wsprintf (buffer, _T("%s"), file.cFileName);
_stprintf (buffer, _T("%s"), file.cFileName);
else
wsprintf (buffer, _T("%s"), file.cAlternateFileName);
_stprintf (buffer, _T("%s"), file.cAlternateFileName);
filecount++;
}

View file

@ -20,6 +20,7 @@
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdio.h>
#include "cmd.h"
@ -222,7 +223,7 @@ BOOL ShowCompletionMatches (LPTSTR str, INT charcount)
continue;
if (file.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
wsprintf (fname,"[%s]", file.cFileName);
_stprintf (fname, _T("[%s]"), file.cFileName);
else
_tcscpy (fname, file.cFileName);

View file

@ -15,9 +15,14 @@ OBJECTS = ../common/crt0.o cmd.o attrib.o alias.o batch.o beep.o call.o \
pause.o prompt.o redir.o ren.o set.o shift.o time.o title.o type.o \
ver.o verify.o vol.o where.o
LIBS= ../../lib/kernel32/kernel32.a ../../lib/ntdll/ntdll.a
LIBS= ../../lib/kernel32/kernel32.a ../../lib/crtdll/crtdll.a
CLEAN_FILES = $(OBJECTS) cmd.exe cmd.sym
CLEAN_FILES = cmd.o attrib.o alias.o batch.o beep.o call.o \
chcp.o cls.o cmdinput.o cmdtable.o color.o console.o copy.o date.o \
del.o dir.o dirstack.o echo.o error.o filecomp.o for.o goto.o \
history.o if.o internal.o label.o locale.o misc.o move.o path.o \
pause.o prompt.o redir.o ren.o set.o shift.o time.o title.o type.o \
ver.o verify.o vol.o where.o cmd.exe cmd.sym
clean: $(CLEAN_FILES:%=%_clean)

View file

@ -237,7 +237,7 @@ INT cmd_time (LPTSTR cmd, LPTSTR param)
return 0;
}
// force input the next time around.
/* force input the next time around. */
nTimeString == -1;
}
ConErrPuts (_T("Invalid time."));