https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1efbcd3d5d84389dec9ec…
commit 1efbcd3d5d84389dec9ec54fbb9ca5d763abe874
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Wed Jul 1 02:06:42 2020 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Wed Aug 19 20:36:04 2020 +0200
[CMD] Improve RMDIR help and MD error message.
---
base/shell/cmd/lang/cs-CZ.rc | 8 ++++----
base/shell/cmd/lang/de-DE.rc | 6 ++++--
base/shell/cmd/lang/el-GR.rc | 8 ++++----
base/shell/cmd/lang/en-US.rc | 8 ++++----
base/shell/cmd/lang/es-ES.rc | 6 ++++--
base/shell/cmd/lang/fr-FR.rc | 8 ++++----
base/shell/cmd/lang/hu-HU.rc | 6 ++++--
base/shell/cmd/lang/id-ID.rc | 8 ++++----
base/shell/cmd/lang/it-IT.rc | 8 ++++----
base/shell/cmd/lang/ja-JP.rc | 4 ++--
base/shell/cmd/lang/no-NO.rc | 8 ++++----
base/shell/cmd/lang/pl-PL.rc | 8 ++++----
base/shell/cmd/lang/ro-RO.rc | 4 ++--
base/shell/cmd/lang/ru-RU.rc | 8 ++++----
base/shell/cmd/lang/sk-SK.rc | 8 ++++----
base/shell/cmd/lang/sq-AL.rc | 8 ++++----
base/shell/cmd/lang/sv-SE.rc | 8 ++++----
base/shell/cmd/lang/tr-TR.rc | 8 ++++----
base/shell/cmd/lang/uk-UA.rc | 8 ++++----
base/shell/cmd/lang/zh-CN.rc | 8 ++++----
base/shell/cmd/lang/zh-TW.rc | 8 ++++----
21 files changed, 80 insertions(+), 74 deletions(-)
diff --git a/base/shell/cmd/lang/cs-CZ.rc b/base/shell/cmd/lang/cs-CZ.rc
index a06ade2dfac..3499a2641a9 100644
--- a/base/shell/cmd/lang/cs-CZ.rc
+++ b/base/shell/cmd/lang/cs-CZ.rc
@@ -322,9 +322,9 @@ PAUSE [message]"
STRING_PROMPT_HELP3 "\nType PROMPT without parameters to reset the prompt to the default setting."
STRING_REM_HELP "Starts a comment line in a batch file.\n\nREM [Comment]"
STRING_RMDIR_HELP "Removes a directory.\n\n\
-RMDIR [drive:]path\nRD [drive:]path\n\
-/S Deletes all files and folders within target\n\
-/Q Doesn't prompt for user\n"
+RMDIR [/S] [/Q] [drive:]path\nRD [/S] [/Q] [drive:]path\n\
+ /S Deletes all files and folders within the target.\n\
+ /Q Doesn't prompt for user.\n"
STRING_RMDIR_HELP2 "Directory is not empty!\n"
STRING_REN_HELP1 "Renames a file/directory or files/directories.\n\n\
RENAME [/E /N /P /Q /S /T] old_name ... new_name\n\
@@ -502,7 +502,7 @@ title new title\n"
STRING_FREE_ERROR2 "bez popisku"
STRING_GOTO_ERROR1 "Pro GOTO nebyl zadán popisek\n"
STRING_GOTO_ERROR2 "Popisek '%s' nenalezen\n"
- STRING_MD_ERROR "Podadresář nebo soubor už existuje.\n"
+ STRING_MD_ERROR "Podadresář nebo soubor %s už existuje.\n"
STRING_MD_ERROR2 "Cesta do nového adresáře neexistuje.\n"
STRING_MOVE_ERROR1 "[OK]\n"
STRING_MOVE_ERROR2 "[Chyba]\n"
diff --git a/base/shell/cmd/lang/de-DE.rc b/base/shell/cmd/lang/de-DE.rc
index 4fa69baa07f..94cb49924e3 100644
--- a/base/shell/cmd/lang/de-DE.rc
+++ b/base/shell/cmd/lang/de-DE.rc
@@ -316,7 +316,9 @@ PAUSE [message]"
STRING_PROMPT_HELP3 "\n 'PROMPT' setzt die Prompt auf die Standardwerte zurück."
STRING_REM_HELP "Leitet Kommentare in einer Batchdatei ein.\n\nREM [Kommentar]"
STRING_RMDIR_HELP "Löscht ein Verzeichnis.\n\n\
-RMDIR [Laufwerk:]Pfad\nRD [Laufwerk:]Pfad"
+RMDIR [/S] [/Q] [Laufwerk:]Pfad\nRD [/S] [/Q] [Laufwerk:]Pfad\n\
+ /S Deletes all files and folders within the target.\n\
+ /Q Doesn't prompt for user.\n"
STRING_RMDIR_HELP2 "Verzeichnis ist nicht leer!\n"//FIXME
STRING_REN_HELP1 "Benennt Dateien und Verzeichnisse um.\n\n\
RENAME [/E /N /P /Q /S /T] alter_Name ... neuer_Name\n\
@@ -496,7 +498,7 @@ Titel neuer Titel"
STRING_FREE_ERROR2 "keine Bezeichnung"
STRING_GOTO_ERROR1 "Keine Sprungmarke für GOTO gesetzt\n"
STRING_GOTO_ERROR2 "Sprungmarke '%s' wurde nicht gefunden\n"
- STRING_MD_ERROR "Unterverzeichnis oder Datei existiert bereits.\n"
+ STRING_MD_ERROR "Unterverzeichnis oder Datei %s existiert bereits.\n"
STRING_MD_ERROR2 "Der Pfad zum neuen Ordner existiert nicht.\n"//FIXME
STRING_MOVE_ERROR1 "[OK]\n"
STRING_MOVE_ERROR2 "[FEHLER]\n"
diff --git a/base/shell/cmd/lang/el-GR.rc b/base/shell/cmd/lang/el-GR.rc
index e49650da179..10a48f409e1 100644
--- a/base/shell/cmd/lang/el-GR.rc
+++ b/base/shell/cmd/lang/el-GR.rc
@@ -321,9 +321,9 @@ PAUSE [message]"
STRING_PROMPT_HELP3 "\nType PROMPT without parameters to reset the prompt to the default setting."
STRING_REM_HELP "Starts a comment line in a batch file.\n\nREM [Comment]"
STRING_RMDIR_HELP "Removes a directory.\n\n\
-RMDIR [drive:]path\nRD [drive:]path\n\
-/S Deletes all files and folders within target\n\
-/Q Doesn't prompt for user\n"
+RMDIR [/S] [/Q] [drive:]path\nRD [/S] [/Q] [drive:]path\n\
+ /S Deletes all files and folders within the target.\n\
+ /Q Doesn't prompt for user.\n"
STRING_RMDIR_HELP2 "Directory is not empty!\n"
STRING_REN_HELP1 "Renames a file/directory or files/directories.\n\n\
RENAME [/E /N /P /Q /S /T] old_name ... new_name\n\
@@ -501,7 +501,7 @@ title new title\n"
STRING_FREE_ERROR2 "unlabeled"
STRING_GOTO_ERROR1 "No label specified for GOTO\n"
STRING_GOTO_ERROR2 "Label '%s' not found\n"
- STRING_MD_ERROR "A subdirectory or file already exists.\n"
+ STRING_MD_ERROR "A subdirectory or file %s already exists.\n"
STRING_MD_ERROR2 "The path to the new folder does not exist.\n"
STRING_MOVE_ERROR1 "[OK]\n"
STRING_MOVE_ERROR2 "[Σφάλμα]\n"
diff --git a/base/shell/cmd/lang/en-US.rc b/base/shell/cmd/lang/en-US.rc
index 943c695b790..e5d0ea5056a 100644
--- a/base/shell/cmd/lang/en-US.rc
+++ b/base/shell/cmd/lang/en-US.rc
@@ -317,9 +317,9 @@ PAUSE [message]"
STRING_PROMPT_HELP3 "\nType PROMPT without parameters to reset the prompt to the default setting."
STRING_REM_HELP "Starts a comment line in a batch file.\n\nREM [Comment]"
STRING_RMDIR_HELP "Removes a directory.\n\n\
-RMDIR [drive:]path\nRD [drive:]path\n\
-/S Deletes all files and folders within target\n\
-/Q Doesn't prompt for user\n"
+RMDIR [/S] [/Q] [drive:]path\nRD [/S] [/Q] [drive:]path\n\
+ /S Deletes all files and folders within the target.\n\
+ /Q Doesn't prompt for user.\n"
STRING_RMDIR_HELP2 "Directory is not empty!\n"
STRING_REN_HELP1 "Renames a file/directory or files/directories.\n\n\
RENAME [/E /N /P /Q /S /T] old_name ... new_name\n\
@@ -497,7 +497,7 @@ title new title\n"
STRING_FREE_ERROR2 "unlabeled"
STRING_GOTO_ERROR1 "No label specified for GOTO\n"
STRING_GOTO_ERROR2 "Label '%s' not found\n"
- STRING_MD_ERROR "A subdirectory or file already exists.\n"
+ STRING_MD_ERROR "A subdirectory or file %s already exists.\n"
STRING_MD_ERROR2 "The path to the new folder does not exist.\n"
STRING_MOVE_ERROR1 "[OK]\n"
STRING_MOVE_ERROR2 "[Error]\n"
diff --git a/base/shell/cmd/lang/es-ES.rc b/base/shell/cmd/lang/es-ES.rc
index 9998bfd1bad..786b5f7e974 100644
--- a/base/shell/cmd/lang/es-ES.rc
+++ b/base/shell/cmd/lang/es-ES.rc
@@ -322,7 +322,9 @@ PAUSE [mensaje]"
comandos a su configuración por defecto."
STRING_REM_HELP "Comienza una liena de comentarios en un archivo por lotes\n\nREM [Comentario]"
STRING_RMDIR_HELP "Elimina un directorio.\n\n\
-RMDIR [unidad:]ruta\nRD [unidad:]ruta"
+RMDIR [/S] [/Q] [unidad:]ruta\nRD [/S] [/Q] [unidad:]ruta\n\
+ /S Deletes all files and folders within the target.\n\
+ /Q Doesn't prompt for user.\n"
STRING_RMDIR_HELP2 "La carpeta no está vacía.\n"
STRING_REN_HELP1 "Renombra un archivo/directorio o varios archivos/directorios.\n\n\
RENAME [/E /N /P /Q /S /T] nombre_antiguo ... nuevo_nombre\n\
@@ -501,7 +503,7 @@ title Nuevo título\n"
STRING_FREE_ERROR2 "Sin etiqueta"
STRING_GOTO_ERROR1 "No se especifico etiqueta para GOTO\n"
STRING_GOTO_ERROR2 "La etiqueta '%s' no se encuentra\n"
- STRING_MD_ERROR "A subdirectory or file already exists.\n"
+ STRING_MD_ERROR "A subdirectory or file %s already exists.\n"
STRING_MD_ERROR2 "The path to the new folder does not exist.\n"
STRING_MOVE_ERROR1 "[Correcto]\n"
STRING_MOVE_ERROR2 "[Error]\n"
diff --git a/base/shell/cmd/lang/fr-FR.rc b/base/shell/cmd/lang/fr-FR.rc
index 646791f8235..7a681fdf5b3 100644
--- a/base/shell/cmd/lang/fr-FR.rc
+++ b/base/shell/cmd/lang/fr-FR.rc
@@ -334,9 +334,9 @@ PAUSE [message]"
STRING_PROMPT_HELP3 "\nTaper PROMPT sans paramètres pour changer l'invite à celui défini par défaut."
STRING_REM_HELP "Démarrer une ligne de commentaire dans un fichier batch.\n\nREM [Commentaire]"
STRING_RMDIR_HELP "Supprime un répertoire.\n\n\
-RMDIR [lecteur:]chemin\nRD [lecteur:]chemin\n\
-/S Supprime tous les fichiers et dossiers dans le répertoire cible\n\
-/Q N'interroge pas l'utilisateur\n"
+RMDIR [/S] [/Q] [lecteur:]chemin\nRD [/S] [/Q] [lecteur:]chemin\n\
+ /S Supprime tous les fichiers et dossiers dans le répertoire cible.\n\
+ /Q N'interroge pas l'utilisateur.\n"
STRING_RMDIR_HELP2 "Le répertoire n'est pas vide!\n"
STRING_REN_HELP1 "Renomme un(des) fichier(s)/répertoire(s)\n\
RENAME [/E /N /P /Q /S /T] ancien_nom ... nouveau_nom\n\
@@ -513,7 +513,7 @@ titre titre de la fenêtre"
STRING_FREE_ERROR2 "sans nom"
STRING_GOTO_ERROR1 "Pas de label indiqué pour GOTO\n"
STRING_GOTO_ERROR2 "Label '%s' introuvable\n"
- STRING_MD_ERROR "Un sous répertoire ou un fichier existe déjà.\n"
+ STRING_MD_ERROR "Un sous-répertoire ou un fichier %s existe déjà.\n"
STRING_MD_ERROR2 "Le chemin vers le nouveau répertoire n'existe pas.\n"
STRING_MOVE_ERROR1 "[OK]\n"
STRING_MOVE_ERROR2 "[Erreur]\n"
diff --git a/base/shell/cmd/lang/hu-HU.rc b/base/shell/cmd/lang/hu-HU.rc
index 518c83364b3..d73faa7c2cc 100644
--- a/base/shell/cmd/lang/hu-HU.rc
+++ b/base/shell/cmd/lang/hu-HU.rc
@@ -303,7 +303,9 @@ PAUSE [message]"
STRING_PROMPT_HELP3 "\nHa paraméter nélkül beírod a PROMPT parancsot, vissza áll az alapértelmezettre a kijelzés."
STRING_REM_HELP "Megjegyzést jelölõ sor batch fájlokban.\n\nREM [megjegyzés]"
STRING_RMDIR_HELP "Eltávolít egy mappát.\n\n\
-RMDIR [meghajtó:]elérési_út\nRD [meghajtó:]elérési_út"
+RMDIR [/S] [/Q] [meghajtó:]elérési_út\nRD [/S] [/Q] [meghajtó:]elérési_út\n\
+ /S Deletes all files and folders within the target.\n\
+ /Q Doesn't prompt for user.\n"
STRING_RMDIR_HELP2 "Directory is not empty!\n"//FIXME
STRING_REN_HELP1 "Átnevez egy állományt.\n\n\
RENAME [/E /N /P /Q /S /T] régi_név ... új_név\n\
@@ -480,7 +482,7 @@ title new title\n"
STRING_FREE_ERROR2 "nincs cimkézve"
STRING_GOTO_ERROR1 "Nem lett cimke megadva a GOTO után\n"
STRING_GOTO_ERROR2 "A '%s' cimke nem található\n"
- STRING_MD_ERROR "A subdirectory or file already exists.\n"//FIXME
+ STRING_MD_ERROR "A subdirectory or file %s already exists.\n"
STRING_MD_ERROR2 "The path to the new folder does not exist.\n"
STRING_MOVE_ERROR1 "[OK]\n"
STRING_MOVE_ERROR2 "[HIBA]\n"
diff --git a/base/shell/cmd/lang/id-ID.rc b/base/shell/cmd/lang/id-ID.rc
index 42bd9e2b516..2f7ce290d59 100644
--- a/base/shell/cmd/lang/id-ID.rc
+++ b/base/shell/cmd/lang/id-ID.rc
@@ -318,9 +318,9 @@ PAUSE [pesan]"
STRING_PROMPT_HELP3 "\nKetik PROMPT tanpa parameter untuk mereset prompt ke setelan standar."
STRING_REM_HELP "Memulai baris komentar dalam file batch.\n\nREM [Komentar]"
STRING_RMDIR_HELP "Menghapus direktori.\n\n\
-RMDIR [drive:]path\nRD [drive:]path\n\
-/S Menghapus semua file dan folder di dalam target\n\
-/Q Tidak bertanya pada pengguna\n"
+RMDIR [/S] [/Q] [drive:]path\nRD [/S] [/Q] [drive:]path\n\
+ /S Menghapus semua file dan folder di dalam target.\n\
+ /Q Tidak bertanya pada pengguna.\n"
STRING_RMDIR_HELP2 "Direktori tidak kosong!\n"
STRING_REN_HELP1 "Mengganti nama file/direktori.\n\n\
RENAME [/E /N /P /Q /S /T] nama_lama ... nama_baru\n\
@@ -496,7 +496,7 @@ title judul baru\n"
STRING_FREE_ERROR2 "tak berlabel"
STRING_GOTO_ERROR1 "Tidak ada label ditetapkan untuk GOTO\n"
STRING_GOTO_ERROR2 "Label '%s' tidak ditemukan\n"
- STRING_MD_ERROR "Subdirektori atau file sudah ada.\n"
+ STRING_MD_ERROR "Subdirektori atau file %s sudah ada.\n"
STRING_MD_ERROR2 "Path ke folder baru tidak ada.\n"
STRING_MOVE_ERROR1 "[OK]\n"
STRING_MOVE_ERROR2 "[Salah]\n"
diff --git a/base/shell/cmd/lang/it-IT.rc b/base/shell/cmd/lang/it-IT.rc
index 0f80bf5504a..e3485640449 100644
--- a/base/shell/cmd/lang/it-IT.rc
+++ b/base/shell/cmd/lang/it-IT.rc
@@ -324,9 +324,9 @@ PAUSE [messaggio]"
STRING_REM_HELP "Inizia una linea di commento.\n\n\
REM [Commento]"
STRING_RMDIR_HELP "Cancella una cartella.\n\n\
-RMDIR [disco:]percorso\nRD [disco:]percorso\n\
-/S cancella tutti i file e le cartelle indicate\n\
-/Q non chiede conferma\n"
+RMDIR [/S] [/Q] [disco:]percorso\nRD [/S] [/Q] [disco:]percorso\n\
+ /S Cancella tutti i file e le cartelle indicate.\n\
+ /Q Non chiede conferma.\n"
STRING_RMDIR_HELP2 "La cartella non è vuota!\n"
STRING_REN_HELP1 "Rinomina file/cartella or file/cartelle.\n\n\
RENAME [/E /N /P /Q /S /T] vecchio_nome ... nuovo_nome\n\
@@ -506,7 +506,7 @@ titolo il nuovo titolo\n"
STRING_FREE_ERROR2 "non etichettato"
STRING_GOTO_ERROR1 "Nessuna etichetta indicata per GOTO\n"
STRING_GOTO_ERROR2 "Etichetta '%s' non trovata\n"
- STRING_MD_ERROR "Una cartella o file esiste già.\n"
+ STRING_MD_ERROR "Una cartella o file %s esiste già.\n"
STRING_MD_ERROR2 "Il percorso della nuova cartella non esiste.\n"
STRING_MOVE_ERROR1 "[OK]\n"
STRING_MOVE_ERROR2 "[Errore]\n"
diff --git a/base/shell/cmd/lang/ja-JP.rc b/base/shell/cmd/lang/ja-JP.rc
index 8d493993447..a0581742431 100644
--- a/base/shell/cmd/lang/ja-JP.rc
+++ b/base/shell/cmd/lang/ja-JP.rc
@@ -326,7 +326,7 @@ PAUSE [メッセージ]"
STRING_PROMPT_HELP3 "\nパラメータを指定せずに PROMPT と入力すると、プロンプトの設定がデフォルトにリセットされます。"
STRING_REM_HELP "バッチ ファイルにコメント (注釈) を記録します。\n\nREM [コメント]"
STRING_RMDIR_HELP "ディレクトリを削除します。\n\n\
-RMDIR [ドライブ:]パス\nRD [ドライブ:]パス\n\
+RMDIR [/S] [/Q] [ドライブ:]パス\nRD [/S] [/Q] [ドライブ:]パス\n\
/S 指定されたディレクトリ内にあるファイルやフォルダもすべて削除します。\n\
/Q 確認のメッセージを表示しません。\n"
STRING_RMDIR_HELP2 "ディレクトリが空ではありません!\n"
@@ -504,7 +504,7 @@ RESTORE ウィンドウを元のサイズに戻します。\n\
STRING_FREE_ERROR2 "ラベルがありません。"
STRING_GOTO_ERROR1 "GOTO にラベルが指定されていません。\n"
STRING_GOTO_ERROR2 "ラベル '%s' が見つかりませんでした。\n"
- STRING_MD_ERROR "すでにディレクトリ内にサブディレクトリかファイルが存在しています。\n"
+ STRING_MD_ERROR "%s すでにディレクトリ内にサブディレクトリかファイルが存在しています。\n"
STRING_MD_ERROR2 "新しいフォルダへのパスが存在していません。\n"
STRING_MOVE_ERROR1 "[OK]\n"
STRING_MOVE_ERROR2 "[エラー]\n"
diff --git a/base/shell/cmd/lang/no-NO.rc b/base/shell/cmd/lang/no-NO.rc
index d5056d19e9d..7cb1bb65431 100644
--- a/base/shell/cmd/lang/no-NO.rc
+++ b/base/shell/cmd/lang/no-NO.rc
@@ -316,9 +316,9 @@ PAUSE [melding]"
STRING_PROMPT_HELP3 "\nSkriv PROMPT uten parameter for å resette ledeteksten."
STRING_REM_HELP "Start en kommentarlinje i en satsvis fil.\n\nREM [Kommentar]"
STRING_RMDIR_HELP "Flytter en mappe.\n\n\
-RMDIR [stasjon:]mappe\nRD [stasjon:]mappe\n\
-/S Sletter alle filer og mapper innenfor målet\n\
-/Q Ikke spør før sletting.\n"
+RMDIR [/S] [/Q] [stasjon:]mappe\nRD [/S] [/Q] [stasjon:]mappe\n\
+ /S Sletter alle filer og mapper innenfor målet.\n\
+ /Q Ikke spør før sletting.\n"
STRING_RMDIR_HELP2 "Mappen er ikke tom!\n"
STRING_REN_HELP1 "Endre navn på fil/mappe eller filer/mapper.\n\n\
ENDRE NAVN [/E /N /P /Q /S /T] gammelt_navn ... nytt_navn\n\
@@ -495,7 +495,7 @@ tittel ny tittel\n"
STRING_FREE_ERROR2 "utmerket"
STRING_GOTO_ERROR1 "Ingen merke spesifisert for GOTO\n"
STRING_GOTO_ERROR2 "Merke '%s' ikke funnet\n"
- STRING_MD_ERROR "En undermappe eller fil finnes allerede.\n"
+ STRING_MD_ERROR "En undermappe eller fil %s finnes allerede.\n"
STRING_MD_ERROR2 "Stien til den nye mappen eksisterer ikke.\n"
STRING_MOVE_ERROR1 "[OK]\n"
STRING_MOVE_ERROR2 "[Feil]\n"
diff --git a/base/shell/cmd/lang/pl-PL.rc b/base/shell/cmd/lang/pl-PL.rc
index c53eddf985c..49d89386170 100644
--- a/base/shell/cmd/lang/pl-PL.rc
+++ b/base/shell/cmd/lang/pl-PL.rc
@@ -324,9 +324,9 @@ PAUSE [wiadomość]"
STRING_PROMPT_HELP3 "\nWpisz PROMPT bez żadnych parametrów, by powrócić do ustawień domyślnych."
STRING_REM_HELP "Definiuje linię komentarza w pliku wsadowym.\n\nREM [komentarz]"
STRING_RMDIR_HELP "Usuwa katalog.\n\n\
-RMDIR [napęd:]ścieżka\nRD [napęd:]ścieżka\n\
-/S Kasuje także wszystkie pliki i podkatalogi w danym katalogu\n\
-/Q Nie wyświetla prośby o potwierdzenie\n"
+RMDIR [/S] [/Q] [napęd:]ścieżka\nRD [/S] [/Q] [napęd:]ścieżka\n\
+ /S Kasuje także wszystkie pliki i podkatalogi w danym katalogu.\n\
+ /Q Nie wyświetla prośby o potwierdzenie.\n"
STRING_RMDIR_HELP2 "Katalog nie jest pusty!\n"
STRING_REN_HELP1 "Zmienia nazwę pliku/katalogu (także wielu).\n\n\
RENAME [/E /N /P /Q /S /T] stara_nazwa ... nowa_nazwa\n\
@@ -502,7 +502,7 @@ title nowy tytuł okna\n"
STRING_FREE_ERROR2 "brak"
STRING_GOTO_ERROR1 "Brak etykiety dla GOTO\n"
STRING_GOTO_ERROR2 "Etykieta '%s' nie została znaleziona\n"
- STRING_MD_ERROR "Istnieje już plik lub podkatalog o tej nazwie.\n"
+ STRING_MD_ERROR "Istnieje już plik lub podkatalog %s o tej nazwie.\n"
STRING_MD_ERROR2 "Ścieżka do nowego katalogu nie jest prawidłowa.\n"
STRING_MOVE_ERROR1 "[OK]\n"
STRING_MOVE_ERROR2 "[Błąd]\n"
diff --git a/base/shell/cmd/lang/ro-RO.rc b/base/shell/cmd/lang/ro-RO.rc
index f406454ee49..a9349427dc8 100644
--- a/base/shell/cmd/lang/ro-RO.rc
+++ b/base/shell/cmd/lang/ro-RO.rc
@@ -352,7 +352,7 @@ PAUSE [mesaj]\n"
STRING_PROMPT_HELP3 "\nTastați PROMPT fără argumente pentru a readuce consola în starea implicită.\n"
STRING_REM_HELP "Începe o linie de comentariu într-un fișier de comenzi.\n\nREM [comentariu]\n"
STRING_RMDIR_HELP "Șterge un director.\n\n\
-RMDIR [unitate:]cale\nRD [unitate:]cale\n\
+RMDIR [/S] [/Q] [unitate:]cale\nRD [/S] [/Q] [unitate:]cale\n\
/S Șterge toate fișierele și directoarele țintă.\n\
/Q Omite cererile de confirmare.\n"
STRING_RMDIR_HELP2 "Directorul nu este gol!\n"
@@ -530,7 +530,7 @@ titlu Noul titlu.\n"
STRING_FREE_ERROR2 "neetichetat"
STRING_GOTO_ERROR1 "Nu a fost specificată nici o etichetă pentru «GOTO»\n"
STRING_GOTO_ERROR2 "Eticheta «%s» nu a fost găsită\n"
- STRING_MD_ERROR "Există deja un fișier sau un subdirector cu acest nume.\n"
+ STRING_MD_ERROR "Există deja un fișier sau un subdirector %s cu acest nume.\n"
STRING_MD_ERROR2 "Calea către noul director nu există.\n"
STRING_MOVE_ERROR1 "[OK]\n"
STRING_MOVE_ERROR2 "[Eroare]\n"
diff --git a/base/shell/cmd/lang/ru-RU.rc b/base/shell/cmd/lang/ru-RU.rc
index f4ffc1c91b9..64c217e547d 100644
--- a/base/shell/cmd/lang/ru-RU.rc
+++ b/base/shell/cmd/lang/ru-RU.rc
@@ -326,9 +326,9 @@ PAUSE [сообщение]"
STRING_PROMPT_HELP3 "\nPROMPT без параметров устанавливает приглашение командной строки по умолчанию."
STRING_REM_HELP "Помещение комментариев в пакетные файлы.\n\nREM [комментарий]"
STRING_RMDIR_HELP "Удаление каталога.\n\n\
-RMDIR [диск:]путь\nRD [диск:]путь\n\
-/S Удаление дерева каталогов\n\
-/Q Отключение запроса подтверждения\n"
+RMDIR [/S] [/Q] [диск:]путь\nRD [/S] [/Q] [диск:]путь\n\
+ /S Удаление дерева каталогов.\n\
+ /Q Отключение запроса подтверждения.\n"
STRING_RMDIR_HELP2 "Каталог не пуст!\n"
STRING_REN_HELP1 "Переименование одного или нескольких файлов/каталогов.\n\n\
RENAME [/E /N /P /Q /S /T] старое_имя ... новое_имя\n\
@@ -507,7 +507,7 @@ RESTORE восстанавливает окно\n\
STRING_FREE_ERROR2 "не отмечено"
STRING_GOTO_ERROR1 "Не определена метка для GOTO\n"
STRING_GOTO_ERROR2 "Метка '%s' не найдена\n"
- STRING_MD_ERROR "Подкаталог или файл уже существует.\n"
+ STRING_MD_ERROR "Подкаталог или файл %s уже существует.\n"
STRING_MD_ERROR2 "Путь к новому каталогу не существует.\n"
STRING_MOVE_ERROR1 "[OK]\n"
STRING_MOVE_ERROR2 "[Ошибка]\n"
diff --git a/base/shell/cmd/lang/sk-SK.rc b/base/shell/cmd/lang/sk-SK.rc
index 8f86dbd0d2f..3bb33e7c01a 100644
--- a/base/shell/cmd/lang/sk-SK.rc
+++ b/base/shell/cmd/lang/sk-SK.rc
@@ -323,9 +323,9 @@ PAUSE [message]"
STRING_PROMPT_HELP3 "\nType PROMPT without parameters to reset the prompt to the default setting."
STRING_REM_HELP "Starts a comment line in a batch file.\n\nREM [Comment]"
STRING_RMDIR_HELP "Removes a directory.\n\n\
-RMDIR [drive:]path\nRD [drive:]path\n\
-/S Deletes all files and folders within target\n\
-/Q Doesn't prompt for user\n"
+RMDIR [/S] [/Q] [drive:]path\nRD [/S] [/Q] [drive:]path\n\
+ /S Deletes all files and folders within the target.\n\
+ /Q Doesn't prompt for user.\n"
STRING_RMDIR_HELP2 "Directory is not empty!\n"
STRING_REN_HELP1 "Renames a file/directory or files/directories.\n\n\
RENAME [/E /N /P /Q /S /T] old_name ... new_name\n\
@@ -503,7 +503,7 @@ title new title\n"
STRING_FREE_ERROR2 "unlabeled"
STRING_GOTO_ERROR1 "No label specified for GOTO\n"
STRING_GOTO_ERROR2 "Label '%s' not found\n"
- STRING_MD_ERROR "A subdirectory or file already exists.\n"
+ STRING_MD_ERROR "A subdirectory or file %s already exists.\n"
STRING_MD_ERROR2 "The path to the new folder does not exist.\n"
STRING_MOVE_ERROR1 "[OK]\n"
STRING_MOVE_ERROR2 "[Chyba]\n"
diff --git a/base/shell/cmd/lang/sq-AL.rc b/base/shell/cmd/lang/sq-AL.rc
index c8b002590fa..f31217025f0 100644
--- a/base/shell/cmd/lang/sq-AL.rc
+++ b/base/shell/cmd/lang/sq-AL.rc
@@ -321,9 +321,9 @@ PAUZE [mesazhi]"
STRING_PROMPT_HELP3 "\nSHFAQ pa parametra për të resetuar ne konfigurimet e automatizuara."
STRING_REM_HELP "Nis një linjë koment në një dokument batch.\n\nREM [Koment"
STRING_RMDIR_HELP "Heq një direktori.\n\n\
-RMDIR [drive:]rrugë\nRD [drive:]rrugë\n\
-/S Fshin të gjitha dokumentat dhe dosjet brenda objektivit\n\
-/Q Nuk e shfaq për përdoruesin\n"
+RMDIR [/S] [/Q] [drive:]rrugë\nRD [/S] [/Q] [drive:]rrugë\n\
+ /S Fshin të gjitha dokumentat dhe dosjet brenda objektivit.\n\
+ /Q Nuk e shfaq për përdoruesin.\n"
STRING_RMDIR_HELP2 "Direktoria nuk është e zbrazët!\n"
STRING_REN_HELP1 "Emeron nje dokument/directori ose dokument/skedë.\n\n\
RENAME [/E /N /P /Q /S /T] emrin_e_vjetër ... emrin_e_ri\n\
@@ -501,7 +501,7 @@ title titull i ri\n"
STRING_FREE_ERROR2 "E paetiketuar"
STRING_GOTO_ERROR1 "Nuk ka etiketa specifikuar për GOTO\n"
STRING_GOTO_ERROR2 "Etikete '%s' Nuk u gjet\n"
- STRING_MD_ERROR "Një nën-skedë ose dokument ekziston.\n"
+ STRING_MD_ERROR "Një nën-skedë ose dokument %s ekziston.\n"
STRING_MD_ERROR2 "Rruga për tek skeda e re nuk ekziston.\n"
STRING_MOVE_ERROR1 "[OK]\n"
STRING_MOVE_ERROR2 "[Error]\n"
diff --git a/base/shell/cmd/lang/sv-SE.rc b/base/shell/cmd/lang/sv-SE.rc
index 4636c1e52e2..41c5131f015 100644
--- a/base/shell/cmd/lang/sv-SE.rc
+++ b/base/shell/cmd/lang/sv-SE.rc
@@ -316,9 +316,9 @@ PAUSE [melding]"
STRING_PROMPT_HELP3 "\nSkriv PROMPT uten parameter för att resette ledetexten."
STRING_REM_HELP "Start en kommentarlinje i en batch-fil.\n\nREM [Kommentar]"
STRING_RMDIR_HELP "Flytter en mapp.\n\n\
-RMDIR [enhet:]mapp\nRD [enhet:]mapp\n\
-/S Sletter alle filer och mappar innenfor målet\n\
-/Q Inte spør før sletting.\n"
+RMDIR [/S] [/Q] [enhet:]mapp\nRD [/S] [/Q] [enhet:]mapp\n\
+ /S Sletter alle filer och mappar innenfor målet.\n\
+ /Q Inte spør før sletting.\n"
STRING_RMDIR_HELP2 "mappn är inte tom!\n"
STRING_REN_HELP1 "Ändra namn på fil/mapp eller filer/mappar.\n\n\
ENDRE NAVN [/E /N /P /Q /S /T] gammelt_namn ... nytt_namn\n\
@@ -495,7 +495,7 @@ tittel ny tittel\n"
STRING_FREE_ERROR2 "utmärkt"
STRING_GOTO_ERROR1 "Inget märke specifiserat för GOTO\n"
STRING_GOTO_ERROR2 "Märke '%s' finns inte\n"
- STRING_MD_ERROR "En undermapp eller fil finns redan.\n"
+ STRING_MD_ERROR "En undermapp eller fil %s finns redan.\n"
STRING_MD_ERROR2 "Stien till den nye mappen exsisterar inte.\n"
STRING_MOVE_ERROR1 "[OK]\n"
STRING_MOVE_ERROR2 "[Fel]\n"
diff --git a/base/shell/cmd/lang/tr-TR.rc b/base/shell/cmd/lang/tr-TR.rc
index e113222c039..44810d8fef2 100644
--- a/base/shell/cmd/lang/tr-TR.rc
+++ b/base/shell/cmd/lang/tr-TR.rc
@@ -324,9 +324,9 @@ PAUSE [ileti]"
STRING_PROMPT_HELP3 "\nÖn tanımlı ayarlamaya istemi sıfırlamak için değişkensiz PROMPT yazınız."
STRING_REM_HELP "Bir toplu iş kütüğünde bir açıklama yatacı başlatır.\n\nREM [Açıklama]"
STRING_RMDIR_HELP "Bir dizin siler.\n\n\
-RMDIR [sürücü:]yol\nRD [sürücü:]yol\n\
-/S Varış içinde tüm kütükleri ve dizinleri siler.\n\
-/Q Kullanıcı için sorma.\n"
+RMDIR [/S] [/Q] [sürücü:]yol\nRD [/S] [/Q] [sürücü:]yol\n\
+ /S Varış içinde tüm kütükleri ve dizinleri siler.\n\
+ /Q Kullanıcı için sorma.\n"
STRING_RMDIR_HELP2 "Dizin boş değil!\n"
STRING_REN_HELP1 "Bir kütüğü/dizini ya da kütükleri/dizinleri yeniden adlandırır.\n\n\
RENAME [/E /N /P /Q /S /T] eski ad ... yeni ad\n\
@@ -502,7 +502,7 @@ başlık Yeni başlık\n"
STRING_FREE_ERROR2 "etiketlenmemiş"
STRING_GOTO_ERROR1 "GOTO için bir etiket belirlenmemiş.\n"
STRING_GOTO_ERROR2 """%s"" etiketi bulunamadı.\n"
- STRING_MD_ERROR "Bir alt dizin ya da kütük önceden var.\n"
+ STRING_MD_ERROR "Bir alt dizin ya da kütük %s önceden var.\n"
STRING_MD_ERROR2 "Yeni dizin için yol yok.\n"
STRING_MOVE_ERROR1 "[Tamam]\n"
STRING_MOVE_ERROR2 "[Yanlışlık]\n"
diff --git a/base/shell/cmd/lang/uk-UA.rc b/base/shell/cmd/lang/uk-UA.rc
index 8ea0e7f5512..2b6a6e85348 100644
--- a/base/shell/cmd/lang/uk-UA.rc
+++ b/base/shell/cmd/lang/uk-UA.rc
@@ -328,9 +328,9 @@ PAUSE [повiдомлення]"
STRING_PROMPT_HELP3 "\nPROMPT без параметрiв встановлює запрошення командного рядка за замовчуванням."
STRING_REM_HELP "Стартує рядок коментаря впакетному файлi.\n\nREM [Comment]"
STRING_RMDIR_HELP "Видалення каталогу.\n\n\
-RMDIR [диск:]шлях\nRD [диск:]шлях\n\
-/S Видалення всього дерева всерединi цiлi\n\
-/Q Вимкнення запиту пiдтвердження\n"
+RMDIR [/S] [/Q] [диск:]шлях\nRD [/S] [/Q] [диск:]шлях\n\
+ /S Видалення всього дерева всерединi цiлi.\n\
+ /Q Вимкнення запиту пiдтвердження.\n"
STRING_RMDIR_HELP2 "Каталог не порожнiй!\n"
STRING_REN_HELP1 "Перейменування одного чи кiлькох файлiв/каталогiв.\n\n\
RENAME [/E /N /P /Q /S /T] старе_iм'я ... нове_iм'я\n\
@@ -507,7 +507,7 @@ title новий заголовок\n"
STRING_FREE_ERROR2 "не вiдмiчено"
STRING_GOTO_ERROR1 "Не визначена мiтка для GOTO\n"
STRING_GOTO_ERROR2 "Мiтка '%s' не знайдена\n"
- STRING_MD_ERROR "Пiдкаталог чи файл вже iснує.\n"
+ STRING_MD_ERROR "Пiдкаталог чи файл %s вже iснує.\n"
STRING_MD_ERROR2 "Шлях до нового каталогу не iснує.\n"
STRING_MOVE_ERROR1 "[OK]\n"
STRING_MOVE_ERROR2 "[Помилка]\n"
diff --git a/base/shell/cmd/lang/zh-CN.rc b/base/shell/cmd/lang/zh-CN.rc
index b8421123d95..724459ca8f4 100644
--- a/base/shell/cmd/lang/zh-CN.rc
+++ b/base/shell/cmd/lang/zh-CN.rc
@@ -301,9 +301,9 @@ PAUSE [消息]"
STRING_PROMPT_HELP3 "\n执行不带参数的 PROMPT 将会把提示符重置为默认设置。"
STRING_REM_HELP "在批处理文件中开始一行注释。\n\nREM [注释]"
STRING_RMDIR_HELP "删除一个目录。\n\n\
-RMDIR [驱动器:]路径\nRD [驱动器:]路径\n\
-/S 删除目标中的所有文件和文件夹。\n\
-/Q 删除时不要提示。\n"
+RMDIR [/S] [/Q] [驱动器:]路径\nRD [/S] [/Q] [驱动器:]路径\n\
+ /S 删除目标中的所有文件和文件夹。\n\
+ /Q 删除时不要提示。\n"
STRING_RMDIR_HELP2 "目录非空!\n"
STRING_REN_HELP1 "重命名一个或者多个文件或文件夹。\n\n\
RENAME [/E /N /P /Q /S /T] 旧名称 ... 新名称\n\
@@ -467,7 +467,7 @@ RESTORE 恢复窗口\n\
STRING_FREE_ERROR2 "未标记"
STRING_GOTO_ERROR1 "没有为 GOTO 指定标签\n"
STRING_GOTO_ERROR2 "标签 '%s' 未找到\n"
- STRING_MD_ERROR "一个子目录或文件已存在。\n"
+ STRING_MD_ERROR "%s 一个子目录或文件已存在。\n"
STRING_MD_ERROR2 "到新文件夹的路径不存在。\n"
STRING_MOVE_ERROR1 "[成功]\n"
STRING_MOVE_ERROR2 "[错误]\n"
diff --git a/base/shell/cmd/lang/zh-TW.rc b/base/shell/cmd/lang/zh-TW.rc
index 18248aec402..d4e37356d5b 100644
--- a/base/shell/cmd/lang/zh-TW.rc
+++ b/base/shell/cmd/lang/zh-TW.rc
@@ -302,9 +302,9 @@ PAUSE [訊息]"
STRING_PROMPT_HELP3 "\n執行不帶參數的 PROMPT 將會把提示符重置為默認設定。"
STRING_REM_HELP "在批處理檔案中開始一行註釋。\n\nREM [註釋]"
STRING_RMDIR_HELP "刪除一個目錄。\n\n\
-RMDIR [驅動器:]路徑\nRD [驅動器:]路徑\n\
-/S 刪除目標中的所有檔案和資料夾。\n\
-/Q 刪除時不要提示。\n"
+RMDIR [/S] [/Q] [驅動器:]路徑\nRD [/S] [/Q] [驅動器:]路徑\n\
+ /S 刪除目標中的所有檔案和資料夾。\n\
+ /Q 刪除時不要提示。\n"
STRING_RMDIR_HELP2 "目錄非空!\n"
STRING_REN_HELP1 "重新命名一個或者多個檔案或資料夾。\n\n\
RENAME [/E /N /P /Q /S /T] 舊名稱 ... 新名稱\n\
@@ -468,7 +468,7 @@ RESTORE 恢復視窗\n\
STRING_FREE_ERROR2 "未標記"
STRING_GOTO_ERROR1 "沒有為 GOTO 指定標籤\n"
STRING_GOTO_ERROR2 "標籤 '%s' 未找到\n"
- STRING_MD_ERROR "一個子目錄或檔案已存在。\n"
+ STRING_MD_ERROR "%s 一個子目錄或檔案已存在。\n"
STRING_MD_ERROR2 "到新資料夾的路徑不存在。\n"
STRING_MOVE_ERROR1 "[成功]\n"
STRING_MOVE_ERROR2 "[錯誤]\n"
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=82bcb3f9f035f96ea1706…
commit 82bcb3f9f035f96ea1706b0a755ac3d5c9ace234
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Fri Aug 7 02:13:27 2020 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Wed Aug 19 20:36:03 2020 +0200
[CMD] Fix the implementation of EXIT /B when a batch context is active.
---
base/shell/cmd/internal.c | 33 +++++++++++++++++++++++++++++----
1 file changed, 29 insertions(+), 4 deletions(-)
diff --git a/base/shell/cmd/internal.c b/base/shell/cmd/internal.c
index 175f4b452a7..b81e6cb5645 100644
--- a/base/shell/cmd/internal.c
+++ b/base/shell/cmd/internal.c
@@ -509,8 +509,12 @@ INT cmd_rmdir (LPTSTR param)
/*
- * set the exitflag to true
+ * Either exits the command interpreter, or quits the current batch context.
*/
+
+/* Enable this define for supporting EXIT /B even when extensions are disabled */
+// #define SUPPORT_EXIT_B_NO_EXTENSIONS
+
INT CommandExit(LPTSTR param)
{
if (!_tcsncmp(param, _T("/?"), 2))
@@ -522,7 +526,7 @@ INT CommandExit(LPTSTR param)
return 0;
}
- if (_tcsnicmp(param, _T("/b"), 2) == 0)
+ if (_tcsnicmp(param, _T("/B"), 2) == 0)
{
param += 2;
@@ -532,8 +536,29 @@ INT CommandExit(LPTSTR param)
*/
if (bc)
{
- bc->current = NULL;
- ExitBatch();
+ /* Windows' CMD compatibility: Use GOTO :EOF */
+ TCHAR EofLabel[] = _T(":EOF");
+
+#ifdef SUPPORT_EXIT_B_NO_EXTENSIONS
+ /*
+ * Temporarily enable extensions so as to support :EOF.
+ *
+ * Our GOTO implementation ensures that, when extensions are
+ * enabled and the label is ':EOF', no immediate change of batch
+ * context (done e.g. via ExitBatch() calls) is performed.
+ * This will therefore ensure that we do not spoil the extensions
+ * state when we restore it below.
+ */
+ BOOL bOldEnableExtensions = bEnableExtensions;
+ bEnableExtensions = TRUE;
+#endif
+
+ cmd_goto(EofLabel);
+
+#ifdef SUPPORT_EXIT_B_NO_EXTENSIONS
+ /* Restore the original state of the extensions */
+ bEnableExtensions = bOldEnableExtensions;
+#endif
}
else
{
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2e4c8c019ebe5d78dbcf4…
commit 2e4c8c019ebe5d78dbcf4397ffa0caa4eabb5d0d
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Wed Jul 22 01:16:53 2020 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Wed Aug 19 20:36:01 2020 +0200
[CMD] GOTO: Fix label parsing.
We note two things, when CMD searches for the corresponding label in the
batch file:
- the first character of the line is always ignored, unless it's a colon;
- the escape caret ^ is supported and interpreted.
Fixes some cmd_winetests.
---
base/shell/cmd/batch.c | 4 +-
base/shell/cmd/cmd.h | 4 ++
base/shell/cmd/goto.c | 97 ++++++++++++++++++++++++++++++++++---------------
base/shell/cmd/parser.c | 3 --
4 files changed, 74 insertions(+), 34 deletions(-)
diff --git a/base/shell/cmd/batch.c b/base/shell/cmd/batch.c
index a5c31aece09..184911c60a6 100644
--- a/base/shell/cmd/batch.c
+++ b/base/shell/cmd/batch.c
@@ -131,7 +131,7 @@ static LPTSTR BatchParams(LPTSTR s1, LPTSTR s2)
BOOL inquotes = FALSE;
/* Find next parameter */
- while (_istspace(*s2) || (*s2 && _tcschr(_T(",;="), *s2)))
+ while (_istspace(*s2) || (*s2 && _tcschr(STANDARD_SEPS, *s2)))
s2++;
if (!*s2)
break;
@@ -139,7 +139,7 @@ static LPTSTR BatchParams(LPTSTR s1, LPTSTR s2)
/* Copy it */
do
{
- if (!inquotes && (_istspace(*s2) || _tcschr(_T(",;="), *s2)))
+ if (!inquotes && (_istspace(*s2) || _tcschr(STANDARD_SEPS, *s2)))
break;
inquotes ^= (*s2 == _T('"'));
*s1++ = *s2++;
diff --git a/base/shell/cmd/cmd.h b/base/shell/cmd/cmd.h
index a6e780bdc6e..f547389024e 100644
--- a/base/shell/cmd/cmd.h
+++ b/base/shell/cmd/cmd.h
@@ -301,6 +301,10 @@ INT cmd_move (LPTSTR);
INT CommandMsgbox (LPTSTR);
/* Prototypes from PARSER.C */
+
+/* These three characters act like spaces to the parser in most contexts */
+#define STANDARD_SEPS _T(",;=")
+
enum { C_COMMAND, C_QUIET, C_BLOCK, C_MULTI, C_OR, C_AND, C_PIPE, C_IF, C_FOR };
typedef struct _PARSED_COMMAND
{
diff --git a/base/shell/cmd/goto.c b/base/shell/cmd/goto.c
index 5831b25e22f..5174b62417f 100644
--- a/base/shell/cmd/goto.c
+++ b/base/shell/cmd/goto.c
@@ -35,7 +35,7 @@
*/
INT cmd_goto(LPTSTR param)
{
- LPTSTR tmp, tmp2;
+ LPTSTR label, tmp;
DWORD dwCurrPos;
BOOL bRetry;
@@ -59,11 +59,9 @@ INT cmd_goto(LPTSTR param)
return 1;
}
- /* Terminate label at first space char */
- tmp = param + 1;
- while (!_istcntrl(*tmp) && !_istspace(*tmp) && (*tmp != _T(':')))
- ++tmp;
- *tmp = _T('\0');
+ /* Strip leading whitespace */
+ while (_istspace(*param))
+ ++param;
/* Support jumping to the end of the file, only if extensions are enabled */
if (bEnableExtensions &&
@@ -78,6 +76,23 @@ INT cmd_goto(LPTSTR param)
return 0;
}
+ /* Skip the first colon or plus sign */
+ if (*param == _T(':') || *param == _T('+'))
+ ++param;
+ /* Terminate the label at the first delimiter character */
+ tmp = param;
+ while (!_istcntrl(*tmp) && !_istspace(*tmp) &&
+ !_tcschr(_T(":+"), *tmp) && !_tcschr(STANDARD_SEPS, *tmp) /* &&
+ !_tcschr(_T("&|<>"), *tmp) */)
+ {
+ ++tmp;
+ }
+ *tmp = _T('\0');
+
+ /* If we don't have any label, bail out */
+ if (!*param)
+ goto NotFound;
+
/*
* Search the next label starting our position, until the end of the file.
* If none has been found, restart at the beginning of the file, and continue
@@ -89,36 +104,59 @@ INT cmd_goto(LPTSTR param)
retry:
while (BatchGetString(textline, ARRAYSIZE(textline)))
{
- INT pos;
- INT_PTR size;
-
if (bRetry && (bc->mempos >= dwCurrPos))
break;
- /* Strip out any trailing spaces or control chars */
- tmp = textline + _tcslen(textline) - 1;
- while (tmp > textline && (_istcntrl(*tmp) || _istspace(*tmp) || (*tmp == _T(':'))))
- --tmp;
- *(tmp + 1) = _T('\0');
+#if 0
+ /* If this is not a label, continue searching */
+ if (!_tcschr(textline, _T(':')))
+ continue;
+#endif
+
+ label = textline;
+
+ /* A bug in Windows' CMD makes it always ignore the
+ * first character of the line, unless it's a colon. */
+ if (*label != _T(':'))
+ ++label;
+
+ /* Strip any leading whitespace */
+ while (_istspace(*label))
+ ++label;
+
+ /* If this is not a label, continue searching */
+ if (*label != _T(':'))
+ continue;
+
+ /* Skip the first colon or plus sign */
+#if 0
+ if (*label == _T(':') || *label == _T('+'))
+ ++label;
+#endif
+ ++label;
+ /* Strip any whitespace between the colon and the label */
+ while (_istspace(*label))
+ ++label;
+ /* Terminate the label at the first delimiter character */
+ tmp = label;
+ while (!_istcntrl(*tmp) && !_istspace(*tmp) &&
+ !_tcschr(_T(":+"), *tmp) && !_tcschr(STANDARD_SEPS, *tmp) &&
+ !_tcschr(_T("&|<>"), *tmp))
+ {
+ /* Support the escape caret */
+ if (*tmp == _T('^'))
+ {
+ /* Move the buffer back one character */
+ memmove(tmp, tmp + 1, (_tcslen(tmp + 1) + 1) * sizeof(TCHAR));
+ /* We will ignore the new character */
+ }
- /* Then leading spaces... */
- tmp = textline;
- while (_istspace(*tmp))
++tmp;
-
- /* All space after leading space terminate the string */
- size = _tcslen(tmp) - 1;
- pos = 0;
- while (tmp + pos < tmp + size)
- {
- if (_istspace(tmp[pos]))
- tmp[pos]=_T('\0');
- ++pos;
}
+ *tmp = _T('\0');
- tmp2 = param;
- /* Use whole label name */
- if ((*tmp == _T(':')) && ((_tcsicmp(++tmp, param) == 0) || (_tcsicmp(tmp, ++tmp2) == 0)))
+ /* Jump if the labels are identical */
+ if (_tcsicmp(label, param) == 0)
{
/* Do not process any more parts of a compound command */
bc->current = NULL;
@@ -132,6 +170,7 @@ retry:
goto retry;
}
+NotFound:
ConErrResPrintf(STRING_GOTO_ERROR2, param);
ExitBatch();
return 1;
diff --git a/base/shell/cmd/parser.c b/base/shell/cmd/parser.c
index e25b63aa91b..20310c77830 100644
--- a/base/shell/cmd/parser.c
+++ b/base/shell/cmd/parser.c
@@ -39,9 +39,6 @@ static const TCHAR *const IfOperatorString[] =
#define IF_MAX_COMPARISON IF_NEQ
};
-/* These three characters act like spaces to the parser in most contexts */
-#define STANDARD_SEPS _T(",;=")
-
static BOOL IsSeparator(TCHAR Char)
{
return _istspace(Char) || (Char && _tcschr(STANDARD_SEPS, Char));
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=71cd64d66a20e91af4cf1…
commit 71cd64d66a20e91af4cf1b702607f9ff8e79bf91
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Mon Jul 27 01:11:23 2020 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Wed Aug 19 20:36:01 2020 +0200
[CMD_ROSTEST] Add tests for GOTO label parsing.
---
modules/rostests/win32/cmd/test_goto_call.cmd | 65 +++++++++++++++++++++--
modules/rostests/win32/cmd/test_goto_call.cmd.exp | 7 +++
2 files changed, 69 insertions(+), 3 deletions(-)
diff --git a/modules/rostests/win32/cmd/test_goto_call.cmd b/modules/rostests/win32/cmd/test_goto_call.cmd
index 6a8d3579bc5..d2356a1b447 100644
--- a/modules/rostests/win32/cmd/test_goto_call.cmd
+++ b/modules/rostests/win32/cmd/test_goto_call.cmd
@@ -11,8 +11,9 @@ setlocal enabledelayedexpansion
:: GOTO/CALL jump to labels present forward to their call-point. Only when
:: the label cannot be found forward, the search is then restarted from the
:: beginning of the batch file onwards up to the original call-point.
-::
-goto :test_start
+
+:: GOTO with a label parameter without ':' works.
+goto test_start
:: Execution must never go there!
:test_goto
@@ -36,7 +37,8 @@ goto :continue
:test_goto
echo Test GOTO ok
-goto :do_test_call
+:: GOTO also understands '+' instead of ':' in its label parameter.
+goto +do_test_call
:test_call
echo Test CALL ok from %0
@@ -44,12 +46,69 @@ echo Test CALL ok from %0
goto :EOF
+::
+:: Next suite of tests.
+::
+
+:: GOTO label search algorithm ignores any whitespace between ':'
+:: and the label name, as well as leading and trailing whitespace.
+ :@tab@continue@space@@space@
+
+
+:: Jumping to a label with escape carets.
+goto :la^^bel2
+
+:la^bel2
+echo Unexpected GOTO jump^^!
+:la^^bel2
+echo GOTO with escape caret worked
+
+
+:: Go to the next tests below.
+goto :continue
+
+
::
:: Next suite of tests.
::
:continue
+::
+:: Extra GOTO syntax checks: separators in the label parameter
+::
+
+:: Whitespace
+goto :testLbl1@tab@ignored
+:testLbl1
+echo Hi there^^!
+
+:: Colon
+goto :testLbl2:ignored
+:testLbl2
+echo Hi there^^!
+
+:: Plus sign
+goto :testLbl3+ignored
+:testLbl3
+echo Hi there^^!
+
+:: Comma
+goto :testLbl4,ignored
+:testLbl4
+echo Hi there^^!
+
+:: Semicolon
+goto :testLbl5;ignored
+:testLbl5
+echo Hi there^^!
+
+:: Equals
+goto :testLbl6;ignored
+:testLbl6
+echo Hi there^^!
+
+
::
:: Testing :EOF support
::
diff --git a/modules/rostests/win32/cmd/test_goto_call.cmd.exp b/modules/rostests/win32/cmd/test_goto_call.cmd.exp
index f375908a87b..3e94300fd76 100644
--- a/modules/rostests/win32/cmd/test_goto_call.cmd.exp
+++ b/modules/rostests/win32/cmd/test_goto_call.cmd.exp
@@ -2,6 +2,13 @@
Test GOTO ok
--------- Testing CALL within batch ---------
Test CALL ok from :test_call
+GOTO with escape caret worked
+Hi there!
+Hi there!
+Hi there!
+Hi there!
+Hi there!
+Hi there!
--------- Testing :EOF support ---------
OK
OK
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c5e6e5a19c38795162992…
commit c5e6e5a19c38795162992b3403542d3d67e4c38a
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Sun Jul 12 17:53:20 2020 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Wed Aug 19 20:36:01 2020 +0200
[CMD] GOTO: Fix handling of the ':EOF' label handling.
- The ':EOF' label feature is available only when extensions are enabled.
- Anything that follows the ':EOF' label, separated by at least one
whitespace character, is ignored, and the batch file terminates.
---
base/shell/cmd/goto.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/base/shell/cmd/goto.c b/base/shell/cmd/goto.c
index 585a9708072..5831b25e22f 100644
--- a/base/shell/cmd/goto.c
+++ b/base/shell/cmd/goto.c
@@ -65,8 +65,10 @@ INT cmd_goto(LPTSTR param)
++tmp;
*tmp = _T('\0');
- /* jump to end of the file */
- if ( _tcsicmp( param, _T(":eof"))==0)
+ /* Support jumping to the end of the file, only if extensions are enabled */
+ if (bEnableExtensions &&
+ (_tcsnicmp(param, _T(":EOF"), 4) == 0) &&
+ (!param[4] || _istspace(param[4])))
{
/* Position at the end of the batch file */
bc->mempos = bc->memsize;