mirror of
https://github.com/reactos/reactos.git
synced 2025-05-31 23:18:39 +00:00
- Minor fixes to work more like WinXP's cmd
- Removed the now obsolete "seta_test.cmd" svn path=/trunk/; revision=33561
This commit is contained in:
parent
b655fc4f5e
commit
92545f124e
7 changed files with 21 additions and 133 deletions
|
@ -292,6 +292,9 @@ BOOL Batch (LPTSTR fullname, LPTSTR firstword, LPTSTR param)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Don't print a newline for this command */
|
||||||
|
bIgnoreEcho = TRUE;
|
||||||
|
|
||||||
TRACE ("Batch: returns TRUE\n");
|
TRACE ("Batch: returns TRUE\n");
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
@ -54,8 +54,6 @@ INT cmd_cls (LPTSTR cmd, LPTSTR param)
|
||||||
coPos, &dwWritten);
|
coPos, &dwWritten);
|
||||||
SetConsoleCursorPosition(hConsole, coPos);
|
SetConsoleCursorPosition(hConsole, coPos);
|
||||||
|
|
||||||
bIgnoreEcho = TRUE;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -154,7 +154,7 @@ typedef NTSTATUS (WINAPI *NtReadVirtualMemoryProc)(HANDLE, PVOID, PVOID, ULONG,
|
||||||
BOOL bExit = FALSE; /* indicates EXIT was typed */
|
BOOL bExit = FALSE; /* indicates EXIT was typed */
|
||||||
BOOL bCanExit = TRUE; /* indicates if this shell is exitable */
|
BOOL bCanExit = TRUE; /* indicates if this shell is exitable */
|
||||||
BOOL bCtrlBreak = FALSE; /* Ctrl-Break or Ctrl-C hit */
|
BOOL bCtrlBreak = FALSE; /* Ctrl-Break or Ctrl-C hit */
|
||||||
BOOL bIgnoreEcho = FALSE; /* Ignore 'newline' before 'cls' */
|
BOOL bIgnoreEcho = FALSE; /* Set this to TRUE to prevent a newline, when executing a command */
|
||||||
INT nErrorLevel = 0; /* Errorlevel of last launched external program */
|
INT nErrorLevel = 0; /* Errorlevel of last launched external program */
|
||||||
BOOL bChildProcessRunning = FALSE;
|
BOOL bChildProcessRunning = FALSE;
|
||||||
DWORD dwChildProcessId = 0;
|
DWORD dwChildProcessId = 0;
|
||||||
|
|
|
@ -157,6 +157,7 @@ VOID ConOutChar (TCHAR c)
|
||||||
VOID ConPuts(LPTSTR szText, DWORD nStdHandle)
|
VOID ConPuts(LPTSTR szText, DWORD nStdHandle)
|
||||||
{
|
{
|
||||||
DWORD dwWritten;
|
DWORD dwWritten;
|
||||||
|
HANDLE hStdHandle;
|
||||||
PCHAR pBuf;
|
PCHAR pBuf;
|
||||||
INT len;
|
INT len;
|
||||||
|
|
||||||
|
@ -167,12 +168,14 @@ VOID ConPuts(LPTSTR szText, DWORD nStdHandle)
|
||||||
#else
|
#else
|
||||||
pBuf = szText;
|
pBuf = szText;
|
||||||
#endif
|
#endif
|
||||||
WriteFile (GetStdHandle (nStdHandle),
|
hStdHandle = GetStdHandle(nStdHandle);
|
||||||
|
|
||||||
|
WriteFile (hStdHandle,
|
||||||
pBuf,
|
pBuf,
|
||||||
len,
|
len,
|
||||||
&dwWritten,
|
&dwWritten,
|
||||||
NULL);
|
NULL);
|
||||||
WriteFile (GetStdHandle (nStdHandle),
|
WriteFile (hStdHandle,
|
||||||
_T("\n"),
|
_T("\n"),
|
||||||
1,
|
1,
|
||||||
&dwWritten,
|
&dwWritten,
|
||||||
|
|
|
@ -1024,7 +1024,7 @@ DirPrintNewList(LPWIN32_FIND_DATA ptrFiles[], /* [IN]Files' Info */
|
||||||
/* Print the line */
|
/* Print the line */
|
||||||
if(lpFlags->bPause)
|
if(lpFlags->bPause)
|
||||||
{
|
{
|
||||||
if (ConOutPrintfPaging(FALSE,_T("%10s %-8s %*s%s %s\n"),
|
if (ConOutPrintfPaging(FALSE,_T("%10s %-6s %*s%s %s\n"),
|
||||||
szDate,
|
szDate,
|
||||||
szTime,
|
szTime,
|
||||||
iSizeFormat,
|
iSizeFormat,
|
||||||
|
@ -1034,7 +1034,7 @@ DirPrintNewList(LPWIN32_FIND_DATA ptrFiles[], /* [IN]Files' Info */
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ConOutPrintf(_T("%10s %-8s %*s%s %s\n"),
|
ConOutPrintf(_T("%10s %-6s %*s%s %s\n"),
|
||||||
szDate,
|
szDate,
|
||||||
szTime,
|
szTime,
|
||||||
iSizeFormat,
|
iSizeFormat,
|
||||||
|
|
|
@ -196,12 +196,12 @@ Optionen k
|
||||||
""-"" vor einer Option setzt die Voreinstellung ausser Kraft, z.B. DIR /-W."
|
""-"" vor einer Option setzt die Voreinstellung ausser Kraft, z.B. DIR /-W."
|
||||||
|
|
||||||
STRING_DIR_HELP2, " Datenträger in Laufwerk %c ist %s\n"
|
STRING_DIR_HELP2, " Datenträger in Laufwerk %c ist %s\n"
|
||||||
STRING_DIR_HELP3, " Datenträger in Laufwerk %c hat keinen Namen\n"
|
STRING_DIR_HELP3, " Datenträger in Laufwerk %c hat keine Bezeichnung\n"
|
||||||
STRING_DIR_HELP4, " Datenträger-Seriennummer ist %04X-%04X\n"
|
STRING_DIR_HELP4, " Volumeseriennummer: %04X-%04X\n"
|
||||||
STRING_DIR_HELP5, "\n Gelistete Dateien:\n%16i Datei(en)% 14s bytes\n"
|
STRING_DIR_HELP5, "\n Anzahl der angezeigten Dateien:\n%16i Datei(en)% 15s Bytes\n"
|
||||||
STRING_DIR_HELP6, "%16i Verzeichnis(se)% 15s bytes\n"
|
STRING_DIR_HELP6, "%16i Verzeichnis(se), % 15s Bytes frei\n"
|
||||||
STRING_DIR_HELP7, "\n Verzeichnisse %s\n\n"
|
STRING_DIR_HELP7, "\n Verzeichnis von %s\n\n"
|
||||||
STRING_DIR_HELP8, "%16i Datei(en)% 14s bytes\n"
|
STRING_DIR_HELP8, "%16i Datei(en)% 14s Bytes\n"
|
||||||
|
|
||||||
STRING_DIRSTACK_HELP1, "Speichert das aktuelle Verzeichnis für den POPD Befehl, und\n\
|
STRING_DIRSTACK_HELP1, "Speichert das aktuelle Verzeichnis für den POPD Befehl, und\n\
|
||||||
wechselt dann zu den festgelegten Verzeichnis.\n\n\
|
wechselt dann zu den festgelegten Verzeichnis.\n\n\
|
||||||
|
|
|
@ -1,116 +0,0 @@
|
||||||
@echo off
|
|
||||||
|
|
||||||
@rem the next line reexecutes the script without params if it was called with params, else we'll get false failures
|
|
||||||
@if not "%1"=="" seta_test.cmd
|
|
||||||
|
|
||||||
@rem the next two lines illustrate bug in existing if code
|
|
||||||
if not "=="=="==" goto failure
|
|
||||||
if "=="=="==" goto next1
|
|
||||||
goto failure
|
|
||||||
:next1
|
|
||||||
if "1"=="2" goto failure
|
|
||||||
if not "1"=="1" goto failure
|
|
||||||
set /a a=1
|
|
||||||
echo.
|
|
||||||
if not "%a%"=="1" goto failure
|
|
||||||
set /a b=a
|
|
||||||
echo.
|
|
||||||
if not "%b%"=="1" goto failure
|
|
||||||
set /a a=!5
|
|
||||||
echo.
|
|
||||||
if not "%a%"=="0" goto failure
|
|
||||||
set /a a=!a
|
|
||||||
echo.
|
|
||||||
if not "%a%"=="1" goto failure
|
|
||||||
set /a a=~5
|
|
||||||
echo.
|
|
||||||
if not "%a%"=="-6" goto failure
|
|
||||||
set /a a=5,a=-a
|
|
||||||
echo.
|
|
||||||
if not "%a%"=="-5" goto failure
|
|
||||||
set /a a=5*7
|
|
||||||
echo.
|
|
||||||
if not "%a%"=="35" goto failure
|
|
||||||
set /a a=2000/10
|
|
||||||
echo.
|
|
||||||
if not "%a%"=="200" goto failure
|
|
||||||
set /a a=42%%9
|
|
||||||
echo.
|
|
||||||
if not "%a%"=="6" goto failure
|
|
||||||
set /a a=5%2
|
|
||||||
echo.
|
|
||||||
if not "%a%"=="5" goto failure
|
|
||||||
set /a a=42^%13
|
|
||||||
echo.
|
|
||||||
if not "%a%"=="423" goto failure
|
|
||||||
set /a a=7+9
|
|
||||||
echo.
|
|
||||||
if not "%a%"=="16" goto failure
|
|
||||||
set /a a=9-7
|
|
||||||
echo.
|
|
||||||
if not "%a%"=="2" goto failure
|
|
||||||
set /a a=9^<^<2
|
|
||||||
echo.
|
|
||||||
if not "%a%"=="36" goto failure
|
|
||||||
set /a a=36^>^>2
|
|
||||||
echo.
|
|
||||||
if not "%a%"=="9" goto failure
|
|
||||||
set /a a=42^&9
|
|
||||||
echo.
|
|
||||||
if not "%a%"=="8" goto failure
|
|
||||||
set /a a=32^9
|
|
||||||
echo.
|
|
||||||
if not "%a%"=="329" goto failure
|
|
||||||
set /a a=32^^9
|
|
||||||
echo.
|
|
||||||
if not "%a%"=="41" goto failure
|
|
||||||
set /a a=10^|22
|
|
||||||
echo.
|
|
||||||
if not "%a%"=="30" goto failure
|
|
||||||
set /a a=2,a*=3
|
|
||||||
echo.
|
|
||||||
if not "%a%"=="6" goto failure
|
|
||||||
set /a a=11,a/=2
|
|
||||||
echo.
|
|
||||||
if not "%a%"=="5" goto failure
|
|
||||||
set /a a=42,a%%=9
|
|
||||||
echo.
|
|
||||||
if not "%a%"=="6" goto failure
|
|
||||||
set /a a=7,a+=9
|
|
||||||
echo.
|
|
||||||
if not "%a%"=="16" goto failure
|
|
||||||
set /a a=9,a-=7
|
|
||||||
echo.
|
|
||||||
if not "%a%"=="2" goto failure
|
|
||||||
set /a a=42,a^&=9
|
|
||||||
echo.
|
|
||||||
if not "%a%"=="8" goto failure
|
|
||||||
set /a a=32,a^^=9
|
|
||||||
echo.
|
|
||||||
if not "%a%"=="41" goto failure
|
|
||||||
set /a a=10,a^|=22
|
|
||||||
echo.
|
|
||||||
if not "%a%"=="30" goto failure
|
|
||||||
set /a a=9,a^<^<=2
|
|
||||||
echo.
|
|
||||||
if not "%a%"=="36" goto failure
|
|
||||||
set /a a=36,a^>^>=2
|
|
||||||
echo.
|
|
||||||
if not "%a%"=="9" goto failure
|
|
||||||
set /a a=1,2
|
|
||||||
echo.
|
|
||||||
if not "%a%"=="1" goto failure
|
|
||||||
set /a a=(a=1,a+2)
|
|
||||||
echo.
|
|
||||||
if "%a%"=="3" goto success
|
|
||||||
goto failure
|
|
||||||
|
|
||||||
:success
|
|
||||||
echo SUCCESS!
|
|
||||||
echo.
|
|
||||||
goto done
|
|
||||||
|
|
||||||
:failure
|
|
||||||
echo FAILURE! remove the echo off and see the last formula that executed before this line
|
|
||||||
echo.
|
|
||||||
:done
|
|
Loading…
Reference in a new issue