[CMD]: New CTTY command.
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Mon, 2 Oct 2017 17:03:01 +0000 (17:03 +0000)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Mon, 2 Oct 2017 17:03:01 +0000 (17:03 +0000)
- Introduce back the CTTY command (that normally only exists on DOS
  versions of COMMAND.COM but doesn't on Windows NT' CMD.EXE), whose aim
  is to "change the active terminal" (syntax: CTTY <dos_device>). To
  achieve that we actually redirect STDIN, STDOUT and STDERR to read/write
  handles opened to the <dos_device>. This is very handy when it comes to
  redirecting all the standard handles to e.g. a serial terminal ("CTTY COM1"
  for example).
- Fix some typos in the resources.

svn path=/trunk/; revision=76029

28 files changed:
reactos/base/shell/cmd/CMakeLists.txt
reactos/base/shell/cmd/cmd.h
reactos/base/shell/cmd/cmdtable.c
reactos/base/shell/cmd/config.h
reactos/base/shell/cmd/ctty.c [new file with mode: 0644]
reactos/base/shell/cmd/lang/cs-CZ.rc
reactos/base/shell/cmd/lang/de-DE.rc
reactos/base/shell/cmd/lang/el-GR.rc
reactos/base/shell/cmd/lang/en-US.rc
reactos/base/shell/cmd/lang/es-ES.rc
reactos/base/shell/cmd/lang/fr-FR.rc
reactos/base/shell/cmd/lang/hu-HU.rc
reactos/base/shell/cmd/lang/id-ID.rc
reactos/base/shell/cmd/lang/it-IT.rc
reactos/base/shell/cmd/lang/ja-JP.rc
reactos/base/shell/cmd/lang/no-NO.rc
reactos/base/shell/cmd/lang/pl-PL.rc
reactos/base/shell/cmd/lang/ro-RO.rc
reactos/base/shell/cmd/lang/ru-RU.rc
reactos/base/shell/cmd/lang/sk-SK.rc
reactos/base/shell/cmd/lang/sq-AL.rc
reactos/base/shell/cmd/lang/sv-SE.rc
reactos/base/shell/cmd/lang/tr-TR.rc
reactos/base/shell/cmd/lang/uk-UA.rc
reactos/base/shell/cmd/lang/zh-CN.rc
reactos/base/shell/cmd/lang/zh-TW.rc
reactos/base/shell/cmd/redir.c
reactos/base/shell/cmd/resource.h

index 64b25fa..351a7e0 100644 (file)
@@ -22,6 +22,7 @@ list(APPEND SOURCE
     color.c
     console.c
     copy.c
+    ctty.c
     date.c
     del.c
     delay.c
index 80e13c3..6a2f680 100644 (file)
@@ -72,7 +72,6 @@ INT cmd_beep (LPTSTR);
 /* Prototypes for CALL.C */
 INT cmd_call (LPTSTR);
 
-
 /* Prototypes for CHOICE.C */
 INT CommandChoice (LPTSTR);
 
@@ -123,9 +122,13 @@ extern COMMAND cmds[];  /* The internal command table */
 
 VOID PrintCommandList (VOID);
 
-
 LPCTSTR GetParsedEnvVar ( LPCTSTR varName, UINT* varNameLen, BOOL ModeSetA );
 
+/* Prototypes for CTTY.C */
+#ifdef INCLUDE_CMD_CTTY
+INT cmd_ctty(LPTSTR);
+#endif
+
 /* Prototypes for COLOR.C */
 INT CommandColor(LPTSTR);
 
@@ -337,6 +340,9 @@ VOID PrintPrompt (VOID);
 INT  cmd_prompt (LPTSTR);
 
 /* Prototypes for REDIR.C */
+HANDLE GetHandle(UINT Number);
+VOID SetHandle(UINT Number, HANDLE Handle);
+
 typedef enum _REDIR_MODE
 {
     REDIR_READ   = 0,
index 05e59e1..83e7dae 100644 (file)
@@ -73,6 +73,10 @@ COMMAND cmds[] =
     {_T("copy"),     0, cmd_copy},
 #endif
 
+#ifdef INCLUDE_CMD_CTTY
+    {_T("ctty"),     0, cmd_ctty},
+#endif
+
 #ifdef INCLUDE_CMD_DATE
     {_T("date"),     0, cmd_date},
 #endif
@@ -168,6 +172,7 @@ COMMAND cmds[] =
 
 #ifdef INCLUDE_CMD_RMDIR
     {_T("rd"), CMD_SPECIAL, cmd_rmdir},
+    {_T("rmdir"), CMD_SPECIAL, cmd_rmdir},
 #endif
 
 #ifdef INCLUDE_CMD_REM
@@ -183,10 +188,6 @@ COMMAND cmds[] =
     {_T("replace"), 0, cmd_replace},
 #endif
 
-#ifdef INCLUDE_CMD_RMDIR
-    {_T("rmdir"), CMD_SPECIAL, cmd_rmdir},
-#endif
-
 #ifdef INCLUDE_CMD_SCREEN
     {_T("screen"), 0, CommandScreen},
 #endif
index 8320df8..e89e1ea 100644 (file)
@@ -56,6 +56,7 @@
 #define INCLUDE_CMD_CLS
 #define INCLUDE_CMD_COLOR
 #define INCLUDE_CMD_COPY
+#define INCLUDE_CMD_CTTY
 #define INCLUDE_CMD_DATE
 #define INCLUDE_CMD_DEL
 #define INCLUDE_CMD_DELAY
diff --git a/reactos/base/shell/cmd/ctty.c b/reactos/base/shell/cmd/ctty.c
new file mode 100644 (file)
index 0000000..c095ab3
--- /dev/null
@@ -0,0 +1,342 @@
+/*
+ *  CTTY.C - ctty (Change TTY) command.
+ *
+ *  This command redirects the first three standard handles
+ *  stdin, stdout, stderr to another terminal.
+ *
+ *
+ *  History:
+ *
+ * 14 Aug 1998 (John P Price)
+ * - Created dummy command.
+ *
+ * 2000/01/14 ska
+ * + Added to change the first three handles to the given device name
+ * + Supports only redirection of stdin and stdout, e.g.:
+ *    C:\> CTTY COM1 >file
+ *  -or-
+ *    C:\> echo Hallo | CTTY COM1 | echo du
+ *  The CTTY command effects the commands on the _next_ line.
+ *
+ * 20 Oct 2016 (Hermes Belusca-Maito)
+ *     Port it to NT.
+ */
+
+#include "precomp.h"
+
+#if defined(INCLUDE_CMD_CTTY) && defined(FEATURE_REDIRECTION)
+
+static WORD
+CheckTerminalDeviceType(IN LPCTSTR pszName)
+{
+    /* Console reserved "file" names */
+    static const LPCWSTR DosLPTDevice = L"LPT";
+    static const LPCWSTR DosCOMDevice = L"COM";
+    static const LPCWSTR DosPRNDevice = L"PRN";
+    static const LPCWSTR DosAUXDevice = L"AUX";
+    static const LPCWSTR DosCONDevice = L"CON";
+    static const LPCWSTR DosNULDevice = L"NUL";
+
+    LPCWSTR DeviceName;
+    ULONG DeviceNameInfo;
+    WORD DeviceType = 0; // 0: Unknown; 1: CON; 2: COM etc...
+
+#ifndef _UNICODE // UNICODE means that TCHAR == WCHAR == UTF-16
+    /* Convert from the current process/thread's codepage to UTF-16 */
+    DWORD len = strlen(pszName) + 1;
+    WCHAR *buffer = cmd_alloc(len * sizeof(WCHAR));
+    if (!buffer)
+    {
+        // SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+        return FALSE;
+    }
+    len = (DWORD)MultiByteToWideChar(CP_THREAD_ACP, // CP_ACP, CP_OEMCP
+                                     0, pszName, (INT)len, buffer, (INT)len);
+    DeviceName = buffer;
+#else
+    DeviceName = pszName;
+#endif
+
+    /*
+     * Check whether we deal with a DOS device, and if so,
+     * strip the path till the file name.
+     * Therefore, things like \\.\CON or C:\some_path\COM1
+     * are transformed into CON or COM1, for example.
+     */
+    DeviceNameInfo = RtlIsDosDeviceName_U(DeviceName);
+    if (DeviceNameInfo != 0)
+    {
+        DeviceName = (LPCWSTR)((ULONG_PTR)DeviceName + ((DeviceNameInfo >> 16) & 0xFFFF));
+
+        if (_wcsnicmp(DeviceName, DosCONDevice, 3) == 0)
+        {
+            DeviceType = 1;
+        }
+        else
+        if ( _wcsnicmp(DeviceName, DosLPTDevice, 3) == 0 ||
+             _wcsnicmp(DeviceName, DosCOMDevice, 3) == 0 || 
+             _wcsnicmp(DeviceName, DosPRNDevice, 3) == 0 ||
+             _wcsnicmp(DeviceName, DosAUXDevice, 3) == 0 ||
+             _wcsnicmp(DeviceName, DosNULDevice, 3) == 0 )
+        {
+            DeviceType = 2;
+        }
+        // else DeviceType = 0;
+    }
+
+#ifndef _UNICODE
+    cmd_free(buffer);
+#endif
+
+    return DeviceType;
+}
+
+/*
+ * See also redir.c!PerformRedirection().
+ *
+ * The CTTY command allows only the usage of CON, COM, AUX, LPT, PRN and NUL
+ * DOS devices as valid terminal devices. Everything else is forbidden.
+ *
+ * CTTY does not set ERRORLEVEL on error.
+ */
+INT cmd_ctty(LPTSTR param)
+{
+    static SECURITY_ATTRIBUTES SecAttr = { sizeof(SECURITY_ATTRIBUTES), NULL, TRUE };
+
+    BOOL Success;
+    WORD DeviceType;
+    HANDLE hDevice, hStdHandles[3]; // hStdIn, hStdOut, hStdErr;
+
+    /* The user asked for help */
+    if (_tcsncmp(param, _T("/?"), 2) == 0)
+    {
+        ConOutResPaging(TRUE, STRING_CTTY_HELP);
+        return 0;
+    }
+
+    if (!*param)
+    {
+        error_req_param_missing();
+        return 1;
+    }
+
+    /* Check whether this is a valid terminal device name */
+    DeviceType = CheckTerminalDeviceType(param);
+    if (DeviceType == 1)
+    {
+        /*
+         * Special case for CON device.
+         *
+         * We do not open CON with GENERIC_READ or GENERIC_WRITE as is,
+         * but instead we separately open CONIN$ and CONOUT$ with both
+         * GENERIC_READ | GENERIC_WRITE access.
+         * We do so because otherwise, opening in particular CON with GENERIC_WRITE
+         * only would open CONOUT$ with an handle not passing the IsConsoleHandle()
+         * test, meaning that we could not use the full console functionalities.
+         */
+        BOOL bRetry = FALSE;
+
+RetryOpenConsole:
+        /*
+         * If we previously failed in opening handles to the console,
+         * this means the existing console is almost destroyed.
+         * Close the existing console and allocate and open a new one.
+         */
+        if (bRetry)
+        {
+            FreeConsole();
+            if (!AllocConsole())
+                return 1;
+        }
+
+        /* Attempt to retrieve a handle for standard input */
+        hStdHandles[0] = CreateFile(_T("CONIN$"),
+                                    GENERIC_READ | GENERIC_WRITE,
+                                    FILE_SHARE_READ | FILE_SHARE_WRITE,
+                                    &SecAttr,
+                                    OPEN_EXISTING,
+                                    0,
+                                    NULL);
+        if (hStdHandles[0] == INVALID_HANDLE_VALUE)
+        {
+            // TODO: Error
+            // error_no_rw_device(param);
+
+            if (bRetry)
+                return 1;
+            bRetry = TRUE;
+            goto RetryOpenConsole;
+        }
+
+        /* Attempt to retrieve a handle for standard output.
+         * Note that GENERIC_READ is needed for IsConsoleHandle() to succeed afterwards. */
+        hStdHandles[1] = CreateFile(_T("CONOUT$"),
+                                    GENERIC_READ | GENERIC_WRITE,
+                                    FILE_SHARE_READ | FILE_SHARE_WRITE,
+                                    &SecAttr,
+                                    OPEN_EXISTING,
+                                    0,
+                                    NULL);
+        if (hStdHandles[1] == INVALID_HANDLE_VALUE)
+        {
+            // TODO: Error
+            // error_no_rw_device(param);
+
+            CloseHandle(hStdHandles[0]);
+
+            if (bRetry)
+                return 1;
+            bRetry = TRUE;
+            goto RetryOpenConsole;
+        }
+
+        /* Duplicate a handle for standard error */
+        Success = DuplicateHandle(GetCurrentProcess(),
+                                  hStdHandles[1],
+                                  GetCurrentProcess(),
+                                  &hStdHandles[2],
+                                  0, // GENERIC_WRITE,
+                                  TRUE,
+                                  DUPLICATE_SAME_ACCESS /* 0 */);
+        if (!Success)
+        {
+            // TODO: Error
+            // error_no_rw_device(param);
+            CloseHandle(hStdHandles[1]);
+            CloseHandle(hStdHandles[0]);
+            return 1;
+        }
+    }
+    else if (DeviceType == 2)
+    {
+        /*
+         * COM and the other devices can only be opened once.
+         * Since we need different handles, we need to duplicate them.
+         */
+
+        /* Attempt to retrieve a handle to the device for read/write access */
+        hDevice = CreateFile(param,
+                             GENERIC_READ | GENERIC_WRITE,
+                             FILE_SHARE_READ | FILE_SHARE_WRITE,
+                             &SecAttr,
+                             OPEN_EXISTING,
+                             0, // FILE_FLAG_OVERLAPPED, // 0,
+                             NULL);
+        if (hDevice == INVALID_HANDLE_VALUE)
+        {
+            // TODO: Error
+            // error_no_rw_device(param);
+            return 1;
+        }
+
+        /* Duplicate a handle for standard input */
+        Success = DuplicateHandle(GetCurrentProcess(),
+                                  hDevice,
+                                  GetCurrentProcess(),
+                                  &hStdHandles[0],
+                                  GENERIC_READ,
+                                  TRUE,
+                                  0);
+        if (!Success)
+        {
+            // TODO: Error
+            // error_no_rw_device(param);
+            CloseHandle(hDevice);
+            return 1;
+        }
+
+        /* Duplicate a handle for standard output */
+        Success = DuplicateHandle(GetCurrentProcess(),
+                                  hDevice,
+                                  GetCurrentProcess(),
+                                  &hStdHandles[1],
+                                  GENERIC_WRITE,
+                                  TRUE,
+                                  0);
+        if (!Success)
+        {
+            // TODO: Error
+            // error_no_rw_device(param);
+            CloseHandle(hStdHandles[0]);
+            CloseHandle(hDevice);
+            return 1;
+        }
+
+        /* Duplicate a handle for standard error */
+        Success = DuplicateHandle(GetCurrentProcess(),
+                                  hDevice,
+                                  GetCurrentProcess(),
+                                  &hStdHandles[2],
+                                  GENERIC_WRITE,
+                                  TRUE,
+                                  0);
+        if (!Success)
+        {
+            // TODO: Error
+            // error_no_rw_device(param);
+            CloseHandle(hStdHandles[1]);
+            CloseHandle(hStdHandles[0]);
+            CloseHandle(hDevice);
+            return 1;
+        }
+
+        /* Now get rid of the main device handle */
+        CloseHandle(hDevice);
+    }
+    else
+    {
+        // FIXME: Localize!
+        ConOutPrintf(L"Invalid device '%s'\n", param);
+        return 1;
+    }
+
+#if 0
+  /* Now change the file descriptors:
+    0 := rdonly
+    1,2 := wronly
+
+    if CTTY is called within a pipe or its I/O is redirected,
+    oldinfd or oldoutfd is not equal to -1. In such case the
+    old*fd is modified in order to effect the file descriptor
+    after the redirections are restored. Otherwise a pipe or
+    redirection would left CTTY in a half-made status.
+  */
+  // int failed;
+  failed = dup2(f, 2);   /* no redirection support */
+  if(oldinfd != -1)
+       dos_close(oldinfd);
+  oldinfd = f;
+  if(oldoutfd != -1)
+       dos_close(oldoutfd);
+  if((oldoutfd = dup(f)) == -1)
+       failed = 1;
+
+  if(failed)
+    error_ctty_dup(param);
+
+  return failed;
+#endif
+
+    /* Now set the standard handles */
+
+    hDevice = GetHandle(0);
+    if (hDevice != INVALID_HANDLE_VALUE)
+        CloseHandle(hDevice);
+    SetHandle(0, hStdHandles[0]);
+
+    hDevice = GetHandle(1);
+    if (hDevice != INVALID_HANDLE_VALUE)
+        CloseHandle(hDevice);
+    SetHandle(1, hStdHandles[1]);
+
+    hDevice = GetHandle(2);
+    if (hDevice != INVALID_HANDLE_VALUE)
+        CloseHandle(hDevice);
+    SetHandle(2, hStdHandles[2]);
+
+    return 0;
+}
+
+#endif /* INCLUDE_CMD_CTTY && FEATURE_REDIRECTION */
+
+/* EOF */
index 805a638..447bf2a 100644 (file)
@@ -108,6 +108,14 @@ COPY [/V][/Y|/-Y][/A|/B] source [/A|/B]\n\
                existing destination file.\n\n\
 The switch /Y may be present in the COPYCMD environment variable.\n\
 ...\n"
+    STRING_CTTY_HELP "Changes the standard I/O terminal device to an auxiliary device.\n\n\
+CTTY device\n\n\
+  device    The terminal device you want to use as the new standard I/O device.\n\
+            This name must refer to a valid character device:\n\
+            AUX, COMx (x=1..N), CON, LPTx (x=1..N), PRN, NUL.\n\
+            CON is usually the default standard I/O device.\n\n\
+To return control to the standard console, type: CTTY CON on the auxiliary\n\
+device."
     STRING_DATE_HELP1 "\nEnter new date (mm%cdd%cyyyy): "
     STRING_DATE_HELP2 "\nEnter new date (dd%cmm%cyyyy): "
     STRING_DATE_HELP3 "\nEnter new date (yyyy%cmm%cdd): "
@@ -139,10 +147,10 @@ ERASE [/N /P /T /Q /S /W /Y /Z /A[[:]attributes]] file ...\n\n\
     STRING_DEL_HELP2 "All files in the directory will be deleted!\nAre you sure (Y/N)?"
     STRING_DEL_HELP3 "    %lu file deleted\n"
     STRING_DEL_HELP4 "    %lu files deleted\n"
-    STRING_DELAY_HELP "pause for n seconds or milliseconds\n\
+    STRING_DELAY_HELP "Pause for n seconds or milliseconds.\n\
 DELAY [/m]n\n\n\
-  /m          specifiy than n are milliseconds\n\
-              otherwise n are seconds\n"
+  /m          Specify that n are in milliseconds,\n\
+              otherwise n are in seconds.\n"
     STRING_DIR_HELP1 "DIR [drive:][path][filename] [/A[[:]attributes]] [/B] [/C] [/D] [/L] [/N]\n\
   [/O[[:]sortorder]] [/P] [/Q] [/R] [/S] [/T[[:]timefield]] [/W] [/X] [/4]\n\n\
   [drive:][path][filename]\n\
@@ -406,7 +414,7 @@ TIMER  [ON|OFF] [/S] [/n] [/Fn]\n\n\
   OFF         set stopwatch OFF\n\
   /S          Split time. Return stopwatch split\n\
               time without changing its value\n\
-  /n          Specifiy the stopwatch number.\n\
+  /n          Specify the stopwatch number.\n\
               Stopwatches available are 0 to 9\n\
               If it is not specified default is 1\n\
   /Fn         Format for output\n\
index 5c4ea50..9b243a2 100644 (file)
@@ -110,6 +110,14 @@ COPY [/V][/Y|/-Y][/A|/B] \n\
                Bestätigen auf.\n\n\
 Die Option /Y ist möglicherweise in der Umgebungsvariablen COPYCMD definiert.\n\
 ..."
+    STRING_CTTY_HELP "Changes the standard I/O terminal device to an auxiliary device.\n\n\
+CTTY device\n\n\
+  device    The terminal device you want to use as the new standard I/O device.\n\
+            This name must refer to a valid character device:\n\
+            AUX, COMx (x=1..N), CON, LPTx (x=1..N), PRN, NUL.\n\
+            CON is usually the default standard I/O device.\n\n\
+To return control to the standard console, type: CTTY CON on the auxiliary\n\
+device."
     STRING_DATE_HELP1 "\nGeben Sie das neue Datum ein (mm%cdd%cyyyy): "
     STRING_DATE_HELP2 "\nGeben Sie das neue Datum ein (dd%cmm%cyyyy): "
     STRING_DATE_HELP3 "\nGeben Sie das neue Datum ein (yyyy%cmm%cdd): "
@@ -133,9 +141,9 @@ ERASE [/N /P /T /Q /W /Y /Z] Dateinamen ...\n\n\
     STRING_DEL_HELP2 "Alle Dateien in diesem Verzeichnis werden gelöscht!\nSind Sie sich sicher (J/N)?"
     STRING_DEL_HELP3 "    %lu Datei(en) gelöscht\n"
     STRING_DEL_HELP4 "    %lu Datei(en) gelöscht\n"
-    STRING_DELAY_HELP "Pause für n Sekunden oder Millisekunden\n\
+    STRING_DELAY_HELP "Pause für n Sekunden oder Millisekunden.\n\
 DELAY [/m]n\n\n\
-  /m          Millisekunden, ansonsten Sekunden\n"
+  /m          Millisekunden, ansonsten Sekunden.\n"
     STRING_DIR_HELP1 "Listet die Dateien und Unterverzeichnisse eines Verzeichnisses auf.\n\n\
 DIR [Laufwerk:][Pfad][Dateiname] [/A[[:]Attribute]] [/B] [/C] [/D] [/L] [/N]\n\
   [/O[[:]Reihenfolge]] [/P] [/Q] [/R] [/S] [/T[[:]timefield]] [/W] [/X] [/4]\n\n\
index 0867187..5c1a7af 100644 (file)
@@ -108,6 +108,14 @@ COPY [/V][/Y|/-Y][/A|/B] προέλευση [/A|/B]\n\
                ενός υπάρχοντος αρχείου προορισμού.\n\n\
 Ο διακόπτης /Y μπορεί να οριστεί από πριν στη μεταβλητή περιβάλλοντος COPYCMD.\n\
 ...\n"
+    STRING_CTTY_HELP "Changes the standard I/O terminal device to an auxiliary device.\n\n\
+CTTY device\n\n\
+  device    The terminal device you want to use as the new standard I/O device.\n\
+            This name must refer to a valid character device:\n\
+            AUX, COMx (x=1..N), CON, LPTx (x=1..N), PRN, NUL.\n\
+            CON is usually the default standard I/O device.\n\n\
+To return control to the standard console, type: CTTY CON on the auxiliary\n\
+device."
     STRING_DATE_HELP1 "\nΕισάγετε νέα ημερομηνία (mm%cdd%cyyyy): "
     STRING_DATE_HELP2 "\nΕισάγετε νέα ημερομηνία (dd%cmm%cyyyy): "
     STRING_DATE_HELP3 "\nΕισάγετε νέα ημερομηνία (yyyy%cmm%cdd): "
@@ -138,10 +146,10 @@ ERASE [/N /P /T /Q /S /W /Y /Z /A[[:]χαρακτηριστικά]] ονόματ
     STRING_DEL_HELP2 "Όλα τα αρχεία στον κατάλογο θα διαγραφούν!\nΕίστε σίγουροι (Y/N)?"
     STRING_DEL_HELP3 "    %lu αρχείο διαγράφηκε\n"
     STRING_DEL_HELP4 "    %lu αρχεία διαγράφηκαν\n"
-    STRING_DELAY_HELP "παύση για n δευτερόλεπτα ή μιλιδευτερόλεπτα\n\
+    STRING_DELAY_HELP "Παύση για n δευτερόλεπτα ή μιλιδευτερόλεπτα.\n\
 DELAY [/m]n\n\n\
-  /m          specifiy than n are milliseconds\n\
-              otherwise n are seconds\n"
+  /m          Specify that n are in milliseconds,\n\
+              otherwise n are in seconds.\n"
     STRING_DIR_HELP1 "DIR [δίσκος:][μονοπάτι][αρχείο] [/A[[:]χαρακτηριστικά]] [/B] [/C] [/D] [/L] [/N]\n\
   [/O[[:]sortorder]] [/P] [/Q] [/R] [/S] [/T[[:]timefield]] [/W] [/X] [/4]\n\n\
   [δίσκος:][μονοπάτι][αρχείο]\n\
@@ -405,7 +413,7 @@ TIMER  [ON|OFF] [/S] [/n] [/Fn]\n\n\
   OFF         set stopwatch OFF\n\
   /S          Split time. Return stopwatch split\n\
               time without changing its value\n\
-  /n          Specifiy the stopwatch number.\n\
+  /n          Specify the stopwatch number.\n\
               Stopwatches available are 0 to 9\n\
               If it is not specified default is 1\n\
   /Fn         Format for output\n\
index b287bfa..cbbfa2b 100644 (file)
@@ -103,6 +103,14 @@ COPY [/V][/Y|/-Y][/A|/B] source [/A|/B]\n\
                existing destination file.\n\n\
 The switch /Y may be present in the COPYCMD environment variable.\n\
 ...\n"
+    STRING_CTTY_HELP "Changes the standard I/O terminal device to an auxiliary device.\n\n\
+CTTY device\n\n\
+  device    The terminal device you want to use as the new standard I/O device.\n\
+            This name must refer to a valid character device:\n\
+            AUX, COMx (x=1..N), CON, LPTx (x=1..N), PRN, NUL.\n\
+            CON is usually the default standard I/O device.\n\n\
+To return control to the standard console, type: CTTY CON on the auxiliary\n\
+device."
     STRING_DATE_HELP1 "\nEnter new date (mm%cdd%cyyyy): "
     STRING_DATE_HELP2 "\nEnter new date (dd%cmm%cyyyy): "
     STRING_DATE_HELP3 "\nEnter new date (yyyy%cmm%cdd): "
@@ -134,10 +142,10 @@ ERASE [/N /P /T /Q /S /W /Y /Z /A[[:]attributes]] file ...\n\n\
     STRING_DEL_HELP2 "All files in the directory will be deleted!\nAre you sure (Y/N)?"
     STRING_DEL_HELP3 "    %lu file deleted\n"
     STRING_DEL_HELP4 "    %lu files deleted\n"
-    STRING_DELAY_HELP "pause for n seconds or milliseconds\n\
+    STRING_DELAY_HELP "Pause for n seconds or milliseconds.\n\
 DELAY [/m]n\n\n\
-  /m          specify than n are milliseconds\n\
-              otherwise n are seconds\n"
+  /m          Specify that n are in milliseconds,\n\
+              otherwise n are in seconds.\n"
     STRING_DIR_HELP1 "DIR [drive:][path][filename] [/A[[:]attributes]] [/B] [/C] [/D] [/L] [/N]\n\
   [/O[[:]sortorder]] [/P] [/Q] [/R] [/S] [/T[[:]timefield]] [/W] [/X] [/4]\n\n\
   [drive:][path][filename]\n\
index a3c5da6..7ac8700 100644 (file)
@@ -105,6 +105,14 @@ COPY [/V][/Y|/-Y][/A|/B] origen [/A|/B]\n\
                existente.\n\n\
 El parametro /Y tiene que estar presente en las variables de entorno de COPYCMD.\n\
 ...\n"
+    STRING_CTTY_HELP "Changes the standard I/O terminal device to an auxiliary device.\n\n\
+CTTY device\n\n\
+  device    The terminal device you want to use as the new standard I/O device.\n\
+            This name must refer to a valid character device:\n\
+            AUX, COMx (x=1..N), CON, LPTx (x=1..N), PRN, NUL.\n\
+            CON is usually the default standard I/O device.\n\n\
+To return control to the standard console, type: CTTY CON on the auxiliary\n\
+device."
     STRING_DATE_HELP1 "\nIntroduce la nueva fecha (mm%cdd%cyyyy): "
     STRING_DATE_HELP2 "\nIntroduce la nueva fecha (dd%cmm%cyyyy): "
     STRING_DATE_HELP3 "\nIntroduce la nueva fecha (yyyy%cmm%cdd): "
@@ -136,10 +144,10 @@ ERASE [/N /P /T /Q /S /W /Y /Z /A[[:]atributos]] archivo ...\n\n\
     STRING_DEL_HELP2 "¡Todos los archivos del directorio van a ser borrados!\n¿Estás seguro? (S/N)?"
     STRING_DEL_HELP3 "    Archivo %lu borrado\n"
     STRING_DEL_HELP4 "    Archivos %lu borrados\n"
-    STRING_DELAY_HELP "Espera por n segundos o milisegundos\n\
+    STRING_DELAY_HELP "Espera por n segundos o milisegundos.\n\
 DELAY [/m]n\n\n\
   /m          Especifica que n son milisegundos\n\
-              En otro caso n son segundos\n"
+              En otro caso n son segundos.\n"
     STRING_DIR_HELP1 "DIR [unidad:][ruta][nombre de archivo] [/A[[:]atributos]] [/B] [/C] [/D] [/L] [/N]\n\
   [/O[[:]orden]] [/P] [/Q] [/R] [/S] [/T[[:]fecha]] [/W] [/X] [/4]\n\n\
   [unidad:][ruta][nombre de archivo]\n\
index d4b02b6..303304f 100644 (file)
@@ -109,6 +109,15 @@ COPY [/V][/Y|/-Y][/A|/B] source [/A|/B]\n\
   /-Y          Affiche un invite de confirmation en cas d'écrasement\n\
                d'un fichier destination existant.\n\n\
 Le switch /Y peut être présent dans la variable d'environnement COPYCMD.\n"
+    STRING_CTTY_HELP "Change le terminal d'I/O standard vers un périphérique\n\
+auxiliaire.\n\n\
+CTTY périph\n\n\
+  périph    Le nouveau terminal d'I/O standard que vous voulez utiliser.\n\
+            Ce nom doit référer vers un périphérique caractère valide:\n\
+            AUX, COMx (x=1..N), CON, LPTx (x=1..N), PRN, NUL.\n\
+            CON est habituellement le périphérique d'I/O standard par défaut.\n\n\
+Pour restaurer le contrôle vers la console standard, entrez: CTTY CON sur\n\
+le périphérique auxiliaire."
     STRING_DATE_HELP1 "\nEntrer la nouvelle date (mm%cdd%cyyyy): "
     STRING_DATE_HELP2 "\nEntrer la nouvelle date (dd%cmm%cyyyy): "
     STRING_DATE_HELP3 "\nEntrer la nouvelle date (yyyy%cmm%cdd): "
@@ -142,10 +151,10 @@ ERASE [/N /P /T /Q /W /Y /Z] fichier ...\n\n\
 Etes vous sûr(e) (O/N) ?"
     STRING_DEL_HELP3 "    %lu fichier effacé\n"
     STRING_DEL_HELP4 "    %lu fichiers effacés\n"
-    STRING_DELAY_HELP "Attend pendant n secondes ou millisecondes\n\
+    STRING_DELAY_HELP "Attend pendant n secondes ou millisecondes.\n\
 DELAY [/m]n\n\n\
-  /m          spécifie que n est en millisecondes\n\
-              sinon n est en secondes"
+  /m          Spécifie que n est en millisecondes,\n\
+              sinon n est en secondes."
     STRING_DIR_HELP1 "DIR [lecteur:][chemin][fichier] [/A[[:]attributs]] [/B] [/C] [/D] [/L] [/N]\n\
   [/O[[:]ordredetri]] [/P] [/Q] [/R] [/S] [/T[[:]heure]] [/W] [/X] [/4]\n\n\
   [lecteur:][chemin][fichier]\n\
index bc8b83a..ef8bcd2 100644 (file)
@@ -96,6 +96,14 @@ COPY [/V][/Y|/-Y][/A|/B] forrás [/A|/B]\n\
   /Y           Igennel válaszol kérdésnél.\n\
   /-Y          Nemmel válaszol kérdésnél.\n\n\
 Az /Y kapcsolót a COPYCMD környezeti változóban is használható.\n"
+    STRING_CTTY_HELP "Changes the standard I/O terminal device to an auxiliary device.\n\n\
+CTTY device\n\n\
+  device    The terminal device you want to use as the new standard I/O device.\n\
+            This name must refer to a valid character device:\n\
+            AUX, COMx (x=1..N), CON, LPTx (x=1..N), PRN, NUL.\n\
+            CON is usually the default standard I/O device.\n\n\
+To return control to the standard console, type: CTTY CON on the auxiliary\n\
+device."
     STRING_DATE_HELP1 "\nÚj dátum (hh%cnn%céééé): "
     STRING_DATE_HELP2 "\nÚj dátum (nn%chh%céééé): "
     STRING_DATE_HELP3 "\nÚj dátum (éééé%chh%cnn): "
@@ -127,10 +135,10 @@ ERASE [/N /P /T /Q /S /W /Y /Z /A[[:]attribútumok]] állomány ...\n\n\
     STRING_DEL_HELP2 "Minden állomány törölve lesz a mappában!\nBiztosan ezt akarod (I/N)?"
     STRING_DEL_HELP3 "    %lu állomány törölve\n"
     STRING_DEL_HELP4 "    %lu állomány törölve\n"
-    STRING_DELAY_HELP "pause for n seconds or milliseconds\n\
+    STRING_DELAY_HELP "Pause for n seconds or milliseconds.\n\
 DELAY [/m]n\n\n\
-  /m          specifiy than n are milliseconds\n\
-              otherwise n are seconds\n"
+  /m          Specify that n are in milliseconds,\n\
+              otherwise n are in seconds.\n"
     STRING_DIR_HELP1 "DIR [meghajtó:][elérési_út][állománynév] [/A[[:]attribútumok]] [/B] [/C] [/D] [/L] [/N]\n\
   [/O[[:]rendezési_feltétel]] [/P] [/Q] [/R] [/S] [/T[[:]idõ]] [/W] [/X] [/4]\n\n\
   [meghajtó:][elérési_út][állományname]\n\
index 7f67f23..b9b67d3 100644 (file)
@@ -105,6 +105,14 @@ COPY [/V][/Y|/-Y][/A|/B] sumber [/A|/B]\n\
                file tujuan yang sudah ada.\n\n\
 Saklar /Y mungkin ada dalam variabel lingkungan COPYCMD.\n\
 ...\n"
+    STRING_CTTY_HELP "Changes the standard I/O terminal device to an auxiliary device.\n\n\
+CTTY device\n\n\
+  device    The terminal device you want to use as the new standard I/O device.\n\
+            This name must refer to a valid character device:\n\
+            AUX, COMx (x=1..N), CON, LPTx (x=1..N), PRN, NUL.\n\
+            CON is usually the default standard I/O device.\n\n\
+To return control to the standard console, type: CTTY CON on the auxiliary\n\
+device."
     STRING_DATE_HELP1 "\nMasukkan tanggal baru (mm%cdd%cyyyy): "
     STRING_DATE_HELP2 "\nMasukkan tanggal baru (dd%cmm%cyyyy): "
     STRING_DATE_HELP3 "\nMasukkan tanggal baru (yyyy%cmm%cdd): "
@@ -136,10 +144,10 @@ ERASE [/N /P /T /Q /S /W /Y /Z /A[[:]attributes]] file ...\n\n\
     STRING_DEL_HELP2 "Semua file dalam direktori akan dihapus!\nAnda yakin (Y/T)?"
     STRING_DEL_HELP3 "    %lu file dihapus\n"
     STRING_DEL_HELP4 "    %lu file dihapus\n"
-    STRING_DELAY_HELP "menunda n detik atau milidetik\n\
+    STRING_DELAY_HELP "Menunda n detik atau milidetik.\n\
 DELAY [/m]n\n\n\
-  /m          menetapkan bahwa n adalah milidetik\n\
-              sebaliknya n adalah detik\n"
+  /m          Menetapkan bahwa n adalah milidetik\n\
+              sebaliknya n adalah detik.\n"
     STRING_DIR_HELP1 "DIR [drive:][path][filename] [/A[[:]attributes]] [/B] [/C] [/D] [/L] [/N]\n\
   [/O[[:]sortorder]] [/P] [/Q] [/R] [/S] [/T[[:]timefield]] [/W] [/X] [/4]\n\n\
   [drive:][path][filename]\n\
index 1f23d5e..916dcfe 100644 (file)
@@ -103,6 +103,14 @@ COPY [/V][/Y|/-Y][/A|/B] sorgente [/A|/B]\n\
                di un file di destinazione già esistente.\n\n\
 La selezione  /Y può trovarsi nella variabile di ambiente  COPYCMD .\n\
 ...\n"
+    STRING_CTTY_HELP "Changes the standard I/O terminal device to an auxiliary device.\n\n\
+CTTY device\n\n\
+  device    The terminal device you want to use as the new standard I/O device.\n\
+            This name must refer to a valid character device:\n\
+            AUX, COMx (x=1..N), CON, LPTx (x=1..N), PRN, NUL.\n\
+            CON is usually the default standard I/O device.\n\n\
+To return control to the standard console, type: CTTY CON on the auxiliary\n\
+device."
     STRING_DATE_HELP1 "\nScrivi la nuova data (mm%cdd%cyyyy): "
     STRING_DATE_HELP2 "\nScrivi la nuova data (dd%cmm%cyyyy): "
     STRING_DATE_HELP3 "\nnScrivi la nuova data (yyyy%cmm%cdd): "
@@ -134,10 +142,10 @@ ERASE [/N /P /T /Q /S /W /Y /Z /A[[:]attributi]] file ...\n\n\
     STRING_DEL_HELP2 "Tutti i file nella cartella saranno cancellati!\nSei sicuro (S/N)?"
     STRING_DEL_HELP3 "    %lu file cancellato\n"
     STRING_DEL_HELP4 "    %lu file cancellati\n"
-    STRING_DELAY_HELP "aspetta per il tempo indicato in secondi o millisecondi\n\
+    STRING_DELAY_HELP "Aspetta per il tempo indicato in secondi o millisecondi.\n\
 DELAY [/m]n\n\n\
-  /m          precisa che n è in millisecondi\n\
-              altrimenti n è in secondi\n"
+  /m          Precisa che n è in millisecondi\n\
+              altrimenti n è in secondi.\n"
     STRING_DIR_HELP1 "DIR [disco:][percorso][nomefilen] [/A[[:]attributi]] [/B] [/C] [/D] [/L] [/N]\n\
   [/O[[:]orderinamento]] [/P] [/Q] [/R] [/S] [/T[[:]tempo]] [/W] [/X] [/4]\n\n\
   [disco:][percorso][nomefilen]\n\
index 70af6ba..eb84b25 100644 (file)
@@ -105,6 +105,14 @@ COPY [/V][/Y|/-Y][/A|/B] コピー元 [/A|/B]\n\
                表示します。\n\n\
 環境変数 COPYCMD でスイッチ /Y が設定されている場合があります。\n\
 ...\n"
+    STRING_CTTY_HELP "Changes the standard I/O terminal device to an auxiliary device.\n\n\
+CTTY device\n\n\
+  device    The terminal device you want to use as the new standard I/O device.\n\
+            This name must refer to a valid character device:\n\
+            AUX, COMx (x=1..N), CON, LPTx (x=1..N), PRN, NUL.\n\
+            CON is usually the default standard I/O device.\n\n\
+To return control to the standard console, type: CTTY CON on the auxiliary\n\
+device."
     STRING_DATE_HELP1 "\n新しい日付を入力してください (mm%cdd%cyyyy): "
     STRING_DATE_HELP2 "\n新しい日付を入力してください (dd%cmm%cyyyy): "
     STRING_DATE_HELP3 "\n新しい日付を入力してください (yyyy%cmm%cdd): "
index 54bfa30..0eb9439 100644 (file)
@@ -103,6 +103,14 @@ COPY [/V][/Y|/-Y][/A|/B] kilde [/A|/B]\n\
                eksisterende destinasjonsfil.\n\n\
 Bryteren /Y kan eksistere i COPYCMD miljøvariabel.\n\
 ...\n"
+    STRING_CTTY_HELP "Changes the standard I/O terminal device to an auxiliary device.\n\n\
+CTTY device\n\n\
+  device    The terminal device you want to use as the new standard I/O device.\n\
+            This name must refer to a valid character device:\n\
+            AUX, COMx (x=1..N), CON, LPTx (x=1..N), PRN, NUL.\n\
+            CON is usually the default standard I/O device.\n\n\
+To return control to the standard console, type: CTTY CON on the auxiliary\n\
+device."
     STRING_DATE_HELP1 "\nSkriv inn ny dato (mm%cdd%cyyyy): "
     STRING_DATE_HELP2 "\nSkriv inn ny dato (dd%cmm%cyyyy): "
     STRING_DATE_HELP3 "\nSkriv inn ny dato (yyyy%cmm%cdd): "
@@ -134,10 +142,10 @@ ERASE [/N /P /T /Q /S /W /Y /Z /A[[:]attributer]] fil ...\n\n\
     STRING_DEL_HELP2 "Alle filer i mappen vil bli slettet!\nEr du sikker (J/N)?"
     STRING_DEL_HELP3 "    %lu fil slettet\n"
     STRING_DEL_HELP4 "    %lu filer slettet\n"
-    STRING_DELAY_HELP "pause i n sekunder eller mikrosekunder\n\
+    STRING_DELAY_HELP "Pause i n sekunder eller mikrosekunder.\n\
 DELAY [/m]n\n\n\
-  /m          spesifiserer at n er mikrosekunder\n\
-              ellers er n sekunder\n"
+  /m          Spesifiserer at n er mikrosekunder\n\
+              ellers er n sekunder.\n"
     STRING_DIR_HELP1 "DIR [stasjon:][mappe][filnavn] [/A[[:]attributter]] [/B] [/C] [/D] [/L] [/N]\n\
   [/O[[:]sortering]] [/P] [/Q] [/R] [/S] [/T[[:]tidsfelt]] [/W] [/X] [/4]\n\n\
   [stasjon:][mappe][filnavn]\n\
index 0c64c06..5bb15f3 100644 (file)
@@ -112,6 +112,14 @@ COPY [/V][/Y|/-Y][/A|/B] źródło [/A|/B]\n\
                istniejącego pliku.\n\n\
 Opcja /Y może znaleźć się wśród zmiennych środowiskowych COPYCMD.\n\
 ...\n"
+    STRING_CTTY_HELP "Changes the standard I/O terminal device to an auxiliary device.\n\n\
+CTTY device\n\n\
+  device    The terminal device you want to use as the new standard I/O device.\n\
+            This name must refer to a valid character device:\n\
+            AUX, COMx (x=1..N), CON, LPTx (x=1..N), PRN, NUL.\n\
+            CON is usually the default standard I/O device.\n\n\
+To return control to the standard console, type: CTTY CON on the auxiliary\n\
+device."
     STRING_DATE_HELP1 "\nPodaj nową datę (mm%cdd%crrrr): "
     STRING_DATE_HELP2 "\nPodaj nową datę (dd%cmm%crrrr): "
     STRING_DATE_HELP3 "\nPodaj nową datę (rrrr%cmm%cdd): "
@@ -142,10 +150,10 @@ ERASE [/N /P /T /Q /S /W /Y /Z /A[[:]attributy]] plik ...\n\n\
     STRING_DEL_HELP2 "Wszystkie pliki w tym katalogu zostaną skasowane!\nCzy jesteś pewien (T/N)?"
     STRING_DEL_HELP3 "    %lu plik skasowany\n"
     STRING_DEL_HELP4 "    %lu pliki(-ów) skasowane(-ych)\n"
-    STRING_DELAY_HELP "Pauzuje na n sekund lub milisekund\n\
+    STRING_DELAY_HELP "Pauzuje na n sekund lub milisekund.\n\
 DELAY [/m]n\n\n\
-  /m          wymusza traktowanie n jako milisekund,\n\
-              w innym wypadku będzie traktowane jako sekundy\n"
+  /m          Wymusza traktowanie n jako milisekund,\n\
+              w innym wypadku będzie traktowane jako sekundy.\n"
     STRING_DIR_HELP1 "DIR [napęd:][ścieżka][pliki] [/A[[:]atrybuty]] [/B] [/C] [/D] [/L] [/N]\n\
   [/O[[:]porządek]] [/P] [/Q] [/R] [/S] [/T[[:]czas]] [/W] [/X] [/4]\n\n\
   [napęd:][ścieżka][nazwa_pliku]\n\
index 92ea9ac..2f5c5e6 100644 (file)
@@ -116,6 +116,14 @@ COPY [/V][/Y|/-Y][/A|/B] sursă [/A|/B]\n\
   /Y           Suprimă cererile de confimare a spurascrierilor.\n\
   /-Y          Emite cereri de confirmare pentru suprascrieri.\n\n\
 Argumentul /Y poate fi prezent în variabila de mediu COPYCMD.\n"
+    STRING_CTTY_HELP "Changes the standard I/O terminal device to an auxiliary device.\n\n\
+CTTY device\n\n\
+  device    The terminal device you want to use as the new standard I/O device.\n\
+            This name must refer to a valid character device:\n\
+            AUX, COMx (x=1..N), CON, LPTx (x=1..N), PRN, NUL.\n\
+            CON is usually the default standard I/O device.\n\n\
+To return control to the standard console, type: CTTY CON on the auxiliary\n\
+device."
     STRING_DATE_HELP1 "\nIntroduceți o nouă dată (ll%czz%caaaa): "
     STRING_DATE_HELP2 "\nIntroduceți o nouă dată (zz%cll%caaaa): "
     STRING_DATE_HELP3 "\nIntroduceți o nouă dată (aaaa%cll%czz): "
index ee3b16a..63d45f9 100644 (file)
@@ -105,6 +105,14 @@ COPY [/V][/Y | /-Y] [/A | /B] источник [/A | /B]\n\
                результирующего файла.\n\n\
 Ключ /Y можно установить через переменную среды COPYCMD.\n\
 ...\n"
+    STRING_CTTY_HELP "Changes the standard I/O terminal device to an auxiliary device.\n\n\
+CTTY device\n\n\
+  device    The terminal device you want to use as the new standard I/O device.\n\
+            This name must refer to a valid character device:\n\
+            AUX, COMx (x=1..N), CON, LPTx (x=1..N), PRN, NUL.\n\
+            CON is usually the default standard I/O device.\n\n\
+To return control to the standard console, type: CTTY CON on the auxiliary\n\
+device."
     STRING_DATE_HELP1 "\nВведите новую дату (мм%cдд%cгггг): "
     STRING_DATE_HELP2 "\nВведите новую дату (дд%cмм%cгггг): "
     STRING_DATE_HELP3 "\nВведите новую дату (гггг%cмм%cдд): "
@@ -137,10 +145,10 @@ ERASE [/N] [/P] [/T] [/Q] [/S] [/W] [/Y] [/Z] [/A[[:]атрибуты]] имен
     STRING_DEL_HELP2 "Все файлы в каталоге будут удалены!\nВы уверены (Y/N)?"
     STRING_DEL_HELP3 "    %lu файл удален\n"
     STRING_DEL_HELP4 "    %lu файлов удалено\n"
-    STRING_DELAY_HELP "паÑ\83за Ð½Ð° n Ñ\81екÑ\83нд Ð¸Ð»Ð¸ Ð¼Ð¸Ð»Ð»Ð¸Ñ\81екÑ\83нд\n\
+    STRING_DELAY_HELP "Ð\9fаÑ\83за Ð½Ð° n Ñ\81екÑ\83нд Ð¸Ð»Ð¸ Ð¼Ð¸Ð»Ð»Ð¸Ñ\81екÑ\83нд.\n\
 DELAY [/m]n\n\n\
-  /m          указывает, что n означает количество миллисекунд\n\
-              иначе n означает количество секунд\n"
+  /m          Указывает, что n означает количество миллисекунд\n\
+              иначе n означает количество секунд.\n"
     STRING_DIR_HELP1 "DIR [диск:][путь][имя_файла] [/A[[:]атрибуты]] [/B] [/C] [/D] [/L] [/N]\n\
   [/O[[:]сортировка]] [/P] [/Q] [/R] [/S] [/T[[:]время]] [/W] [/X] [/4]\n\n\
   [диск:][путь][имя_файла]\n\
index b257571..e705969 100644 (file)
@@ -109,6 +109,14 @@ COPY [/V][/Y|/-Y][/A|/B] source [/A|/B]\n\
                existing destination file.\n\n\
 The switch /Y may be present in the COPYCMD environment variable.\n\
 ...\n"
+    STRING_CTTY_HELP "Changes the standard I/O terminal device to an auxiliary device.\n\n\
+CTTY device\n\n\
+  device    The terminal device you want to use as the new standard I/O device.\n\
+            This name must refer to a valid character device:\n\
+            AUX, COMx (x=1..N), CON, LPTx (x=1..N), PRN, NUL.\n\
+            CON is usually the default standard I/O device.\n\n\
+To return control to the standard console, type: CTTY CON on the auxiliary\n\
+device."
     STRING_DATE_HELP1 "\nZadajte nový dátum (mm%cdd%crrrr): "
     STRING_DATE_HELP2 "\nZadajte nový dátum (dd%cmm%crrrr): "
     STRING_DATE_HELP3 "\nZadajte nový dátum (rrrr%cmm%cdd): "
@@ -140,10 +148,10 @@ ERASE [/N /P /T /Q /S /W /Y /Z /A[[:]attributes]] file ...\n\n\
     STRING_DEL_HELP2 "All files in the directory will be deleted!\nAre you sure (Y/N)?"
     STRING_DEL_HELP3 "    %lu file deleted\n"
     STRING_DEL_HELP4 "    %lu files deleted\n"
-    STRING_DELAY_HELP "pause for n seconds or milliseconds\n\
+    STRING_DELAY_HELP "Pause for n seconds or milliseconds.\n\
 DELAY [/m]n\n\n\
-  /m          specifiy than n are milliseconds\n\
-              otherwise n are seconds\n"
+  /m          Specify that n are in milliseconds,\n\
+              otherwise n are in seconds.\n"
     STRING_DIR_HELP1 "DIR [drive:][path][filename] [/A[[:]attributes]] [/B] [/C] [/D] [/L] [/N]\n\
   [/O[[:]sortorder]] [/P] [/Q] [/R] [/S] [/T[[:]timefield]] [/W] [/X] [/4]\n\n\
   [drive:][path][filename]\n\
@@ -407,7 +415,7 @@ TIMER  [ON|OFF] [/S] [/n] [/Fn]\n\n\
   OFF         set stopwatch OFF\n\
   /S          Split time. Return stopwatch split\n\
               time without changing its value\n\
-  /n          Specifiy the stopwatch number.\n\
+  /n          Specify the stopwatch number.\n\
               Stopwatches available are 0 to 9\n\
               If it is not specified default is 1\n\
   /Fn         Format for output\n\
index 24a5b72..05f78a1 100644 (file)
@@ -107,6 +107,14 @@ COPY [/V][/Y|/-Y][/A|/B] burimi [/A|/B]\n\
                destinacion dokumenti ekzistues.\n\n\
 Parametri /Y mund të jetë prezent në variabëlat e mjedisit COPYCMD.\n\
 ...\n"
+    STRING_CTTY_HELP "Changes the standard I/O terminal device to an auxiliary device.\n\n\
+CTTY device\n\n\
+  device    The terminal device you want to use as the new standard I/O device.\n\
+            This name must refer to a valid character device:\n\
+            AUX, COMx (x=1..N), CON, LPTx (x=1..N), PRN, NUL.\n\
+            CON is usually the default standard I/O device.\n\n\
+To return control to the standard console, type: CTTY CON on the auxiliary\n\
+device."
     STRING_DATE_HELP1 "\nShkruani datën e re (mm%cdd%cyyyy): "
     STRING_DATE_HELP2 "\nShkruani datën e re (dd%cmm%cyyyy): "
     STRING_DATE_HELP3 "\nShkruani datën e re (yyyy%cmm%cdd): "
@@ -138,10 +146,10 @@ ERASE [/N /P /T /Q /S /W /Y /Z /A[[:]attributes]] file ...\n\n\
     STRING_DEL_HELP2 "Të gjitha dokumentet në skedare do të fshihen!\nJeni i sigurtë (P/J)?"
     STRING_DEL_HELP3 "    %lu u fshi\n"
     STRING_DEL_HELP4 "    %lu u fshinë\n"
-    STRING_DELAY_HELP "pauzë për sekonda ose milisekonda\n\
+    STRING_DELAY_HELP "Pauzë për sekonda ose milisekonda.\n\
 DELAY [/m]n\n\n\
-  /m          specifikoni se n janë millisekonda\n\
-              ndryshe n janë sekonda\n"
+  /m          Specifikoni se n janë millisekonda\n\
+              ndryshe n janë sekonda.\n"
     STRING_DIR_HELP1 "DIR [drive:][rrugë][emer] [/A[[:]attributes]] [/B] [/C] [/D] [/L] [/N]\n\
   [/O[[:]radhitje]] [/P] [/Q] [/R] [/S] [/T[[:]koha]] [/W] [/X] [/4]\n\n\
   [drive:][rrugë][emer]\n\
index 559fd37..4eee829 100644 (file)
@@ -103,6 +103,14 @@ COPY [/V][/Y|/-Y][/A|/B] källa [/A|/B]\n\
                befintlig destinationsfil.\n\n\
 Växeln /Y kan läggas in i COPYCMD miljövariabel.\n\
 ...\n"
+    STRING_CTTY_HELP "Changes the standard I/O terminal device to an auxiliary device.\n\n\
+CTTY device\n\n\
+  device    The terminal device you want to use as the new standard I/O device.\n\
+            This name must refer to a valid character device:\n\
+            AUX, COMx (x=1..N), CON, LPTx (x=1..N), PRN, NUL.\n\
+            CON is usually the default standard I/O device.\n\n\
+To return control to the standard console, type: CTTY CON on the auxiliary\n\
+device."
     STRING_DATE_HELP1 "\nSkriv in nytt datum (mm%cdd%cyyyy): "
     STRING_DATE_HELP2 "\nSkriv in nytt datum (dd%cmm%cyyyy): "
     STRING_DATE_HELP3 "\nSkriv in nytt datum (yyyy%cmm%cdd): "
@@ -134,10 +142,10 @@ ERASE [/N /P /T /Q /S /W /Y /Z /A[[:]attribut]] fil ...\n\n\
     STRING_DEL_HELP2 "Alla filer i mappen kommer att bli raderade!\nÄr du säker (J/N)?"
     STRING_DEL_HELP3 "    %lu fil raderade\n"
     STRING_DEL_HELP4 "    %lu filer raderade\n"
-    STRING_DELAY_HELP "paus i n sekunder eller mikrosekunder\n\
+    STRING_DELAY_HELP "Paus i n sekunder eller mikrosekunder.\n\
 DELAY [/m]n\n\n\
-  /m          anger at n är mikrosekunder\n\
-              annars är n sekunder\n"
+  /m          Anger at n är mikrosekunder\n\
+              annars är n sekunder.\n"
     STRING_DIR_HELP1 "DIR [enhet:][mapp][filnamn] [/A[[:]attribut]] [/B] [/C] [/D] [/L] [/N]\n\
   [/O[[:]sortering]] [/P] [/Q] [/R] [/S] [/T[[:]tidsfält]] [/W] [/X] [/4]\n\n\
   [enhet:][mapp][filnamn]\n\
index a6492ee..b2cf894 100644 (file)
@@ -105,6 +105,14 @@ COPY [/V][/Y|/-Y][/A|/B] kaynak [/A|/B]\n\
                onaylamak için sormaya neden olur.\n\n\
 /Y seçeneği COPYCMD ortam değişkeninin içinde olabilir.\n\
 ...\n"
+    STRING_CTTY_HELP "Changes the standard I/O terminal device to an auxiliary device.\n\n\
+CTTY device\n\n\
+  device    The terminal device you want to use as the new standard I/O device.\n\
+            This name must refer to a valid character device:\n\
+            AUX, COMx (x=1..N), CON, LPTx (x=1..N), PRN, NUL.\n\
+            CON is usually the default standard I/O device.\n\n\
+To return control to the standard console, type: CTTY CON on the auxiliary\n\
+device."
     STRING_DATE_HELP1 "\nYeni târihi giriniz (mm%cdd%cyyyy): "
     STRING_DATE_HELP2 "\nYeni târihi giriniz (dd%cmm%cyyyy): "
     STRING_DATE_HELP3 "\nYeni târihi giriniz (yyyy%cmm%cdd): "
@@ -137,10 +145,10 @@ ERASE [/N /P /T /Q /S /W /Y /Z /A[[:]öz nitelikler]] kütük ...\n\n\
     STRING_DEL_HELP2 "Dizindeki tüm kütükler silinecek!\nEmin misiniz (Y/N)?"
     STRING_DEL_HELP3 "    %lu kütük silindi\n"
     STRING_DEL_HELP4 "    %lu kütük silindi\n"
-    STRING_DELAY_HELP "n sâniye ya da milisâniye duraklat\n\
+    STRING_DELAY_HELP "n sâniye ya da milisâniye duraklat.\n\
 DELAY [/m]n\n\n\
   /m          n milisâniye olarak belirtir\n\
-              yoksa n sâniyedir\n"
+              yoksa n sâniyedir.\n"
     STRING_DIR_HELP1 "DIR [sürücü:][yol][kütük adı] [/A[[:]öz nitelikler]] [/B] [/C] [/D] [/L] [/N]\n\
   [/O[[:]dizme düzeni]] [/P] [/Q] [/R] [/S] [/T[[:]zaman aralığı]] [/W] [/X] [/4]\n\n\
   [sürücü:][yol][kütük adı]\n\
index ec25050..063d0c4 100644 (file)
@@ -111,6 +111,14 @@ COPY [/V][/Y|/-Y][/A|/B] джерело [/A|/B]\n\
                результуючого файлу.\n\n\
 Ключ /Y можна встановити через змiнну середовища COPYCMD.\n\
 ...\n"
+    STRING_CTTY_HELP "Changes the standard I/O terminal device to an auxiliary device.\n\n\
+CTTY device\n\n\
+  device    The terminal device you want to use as the new standard I/O device.\n\
+            This name must refer to a valid character device:\n\
+            AUX, COMx (x=1..N), CON, LPTx (x=1..N), PRN, NUL.\n\
+            CON is usually the default standard I/O device.\n\n\
+To return control to the standard console, type: CTTY CON on the auxiliary\n\
+device."
     STRING_DATE_HELP1 "\nВведiть нову дату (mm%cdd%cyyyy): "
     STRING_DATE_HELP2 "\nВведiть нову дату (dd%cmm%cyyyy): "
     STRING_DATE_HELP3 "\nВведiть нову дату (yyyy%cmm%cdd): "
@@ -145,10 +153,10 @@ ERASE [/N /P /T /Q /S /W /Y /Z /A[[:]атрибути]] iмена_файлiв ..
     STRING_DEL_HELP2 "Всi файли в каталозi будуть видалннi!\nВи впевненi (Y/N)?"
     STRING_DEL_HELP3 "    %lu файл видалено\n"
     STRING_DEL_HELP4 "    %lu файлiв видалено\n"
-    STRING_DELAY_HELP "паÑ\83за Ð½Ð° n Ñ\81екÑ\83нд Ñ\87и Ð¼iлiÑ\81екÑ\83нд\n\
+    STRING_DELAY_HELP "Ð\9fаÑ\83за Ð½Ð° n Ñ\81екÑ\83нд Ñ\87и Ð¼iлiÑ\81екÑ\83нд.\n\
 DELAY [/m]n\n\n\
-  /m          Ð²казує, що n це мiлiсекунди\n\
-              iнакше n це кiлькiсть секунд\n"
+  /m          Ð\92казує, що n це мiлiсекунди\n\
+              iнакше n це кiлькiсть секунд.\n"
     STRING_DIR_HELP1 "DIR [диск:][шлях][iм'я_файлу] [/A[[:]атрибути]] [/B] [/C] [/D] [/L] [/N]\n\
   [/O[[:]порядок]] [/P] [/Q] [/R] [/S] [/T[[:]час]] [/W] [/X] [/4]\n\n\
   [диск:][шлях][iм'я_файлу]\n\
index 3f5a4cb..bce3965 100644 (file)
@@ -100,6 +100,14 @@ COPY [/V][/Y|/-Y][/A|/B] 源 [/A|/B]\n\
   /-Y            覆盖一个已存在的文件时请求确认。\n\n\
 /Y 开关也可以在 COPYCMD 环境变量中指定。\n\
 ...\n"
+    STRING_CTTY_HELP "Changes the standard I/O terminal device to an auxiliary device.\n\n\
+CTTY device\n\n\
+  device    The terminal device you want to use as the new standard I/O device.\n\
+            This name must refer to a valid character device:\n\
+            AUX, COMx (x=1..N), CON, LPTx (x=1..N), PRN, NUL.\n\
+            CON is usually the default standard I/O device.\n\n\
+To return control to the standard console, type: CTTY CON on the auxiliary\n\
+device."
     STRING_DATE_HELP1 "\n输入新的日期 (mm%cdd%cyyyy):"
     STRING_DATE_HELP2 "\n输入新的日期 (dd%cmm%cyyyy):"
     STRING_DATE_HELP3 "\n输入新的日期 (yyyy%cmm%cdd):"
index db7a031..3a108bf 100644 (file)
@@ -100,6 +100,14 @@ COPY [/V][/Y|/-Y][/A|/B] 源 [/A|/B]\n\
   /-Y            覆蓋一個已存在的檔案時請求確認。\n\n\
 /Y 開關也可以在 COPYCMD 環境變數中指定。\n\
 ...\n"
+    STRING_CTTY_HELP "Changes the standard I/O terminal device to an auxiliary device.\n\n\
+CTTY device\n\n\
+  device    The terminal device you want to use as the new standard I/O device.\n\
+            This name must refer to a valid character device:\n\
+            AUX, COMx (x=1..N), CON, LPTx (x=1..N), PRN, NUL.\n\
+            CON is usually the default standard I/O device.\n\n\
+To return control to the standard console, type: CTTY CON on the auxiliary\n\
+device."
     STRING_DATE_HELP1 "\n輸入新的日期 (mm%cdd%cyyyy):"
     STRING_DATE_HELP2 "\n輸入新的日期 (dd%cmm%cyyyy):"
     STRING_DATE_HELP3 "\n輸入新的日期 (yyyy%cmm%cdd):"
index 50f573a..383c08a 100644 (file)
 static const PCON_STREAM StdStreams[] = { StdIn, StdOut, StdErr };
 static HANDLE ExtraHandles[10 - 3]; // 3 == ARRAYSIZE(StdStreams)
 
-static HANDLE GetHandle(UINT Number)
+HANDLE GetHandle(UINT Number)
 {
     if (Number < 3)
         return ConStreamGetOSHandle(StdStreams[Number]);
         // return GetStdHandle(STD_INPUT_HANDLE - Number);
-    else
+    else if (Number < ARRAYSIZE(ExtraHandles) + 3)
         return ExtraHandles[Number - 3];
+    else
+        return INVALID_HANDLE_VALUE;
 }
 
-static VOID SetHandle(UINT Number, HANDLE Handle)
+VOID SetHandle(UINT Number, HANDLE Handle)
 {
     if (Number < 3)
     {
@@ -53,10 +55,8 @@ static VOID SetHandle(UINT Number, HANDLE Handle)
         /* Synchronize the associated Win32 handle */
         SetStdHandle(STD_INPUT_HANDLE - Number, Handle);
     }
-    else
-    {
+    else if (Number < ARRAYSIZE(ExtraHandles) + 3)
         ExtraHandles[Number - 3] = Handle;
-    }
 }
 
 BOOL
index fdd98d5..8397877 100644 (file)
@@ -84,6 +84,8 @@
 #define STRING_ASSOC_HELP  616
 #define STRING_MKLINK_HELP 617
 
+#define STRING_CTTY_HELP   618
+
 #define STRING_CMD_INFOLINE     620
 #define STRING_REACTOS_VERSION  623
 #define STRING_CMD_SHELLINFO    624