https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2dbbfe86ab5b72f6e111e…
commit 2dbbfe86ab5b72f6e111e56b7fbd6ae2cba34c17
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Thu Jun 10 04:10:55 2021 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Thu Jun 10 04:10:55 2021 +0200
[MORE] Use positional elements to build the MORE prompt, whose state is controlled by
flags.
---
base/applications/cmdutils/more/lang/bg-BG.rc | 12 +--
base/applications/cmdutils/more/lang/ca-ES.rc | 12 +--
base/applications/cmdutils/more/lang/cs-CZ.rc | 12 +--
base/applications/cmdutils/more/lang/de-DE.rc | 12 +--
base/applications/cmdutils/more/lang/el-GR.rc | 12 +--
base/applications/cmdutils/more/lang/en-US.rc | 12 +--
base/applications/cmdutils/more/lang/es-ES.rc | 12 +--
base/applications/cmdutils/more/lang/et-EE.rc | 12 +--
base/applications/cmdutils/more/lang/fr-FR.rc | 12 +--
base/applications/cmdutils/more/lang/it-IT.rc | 12 +--
base/applications/cmdutils/more/lang/lt-LT.rc | 12 +--
base/applications/cmdutils/more/lang/no-NO.rc | 12 +--
base/applications/cmdutils/more/lang/pl-PL.rc | 12 +--
base/applications/cmdutils/more/lang/ro-RO.rc | 12 +--
base/applications/cmdutils/more/lang/ru-RU.rc | 12 +--
base/applications/cmdutils/more/lang/sk-SK.rc | 12 +--
base/applications/cmdutils/more/lang/sq-AL.rc | 12 +--
base/applications/cmdutils/more/lang/sv-SE.rc | 12 +--
base/applications/cmdutils/more/lang/tr-TR.rc | 12 +--
base/applications/cmdutils/more/lang/uk-UA.rc | 12 +--
base/applications/cmdutils/more/lang/zh-CN.rc | 12 +--
base/applications/cmdutils/more/lang/zh-TW.rc | 12 +--
base/applications/cmdutils/more/more.c | 127 ++++++++++++++++----------
base/applications/cmdutils/more/resource.h | 15 +--
24 files changed, 217 insertions(+), 189 deletions(-)
diff --git a/base/applications/cmdutils/more/lang/bg-BG.rc
b/base/applications/cmdutils/more/lang/bg-BG.rc
index 24a8a384a2f..1372cfa7dd5 100644
--- a/base/applications/cmdutils/more/lang/bg-BG.rc
+++ b/base/applications/cmdutils/more/lang/bg-BG.rc
@@ -42,11 +42,11 @@ at the ""-- Continue --"" prompt:\n\
<Space> Display the next page.\n\
<Enter> Display the next line.\n"
- IDS_CONTINUE "-- Продължаване --"
- IDS_CONTINUE_PROGRESS "-- Продължаване (%d%%) --"
+ IDS_BAD_FLAG "Invalid argument - '%s'\n"
IDS_FILE_ACCESS "Няма достъп до файл %s.\n"
- IDS_BAD_FLAG "Invalid argument - '%ls'\n"
- IDS_CONTINUE_OPTIONS "-- Continue (%d%%) [Options:
psfq=<Space><Enter>] --"
- IDS_CONTINUE_LINES "-- Continue (%d%%) -- Lines: "
- IDS_CONTINUE_LINE_AT "-- Continue (%d%%) [Line:%d] --"
+ IDS_CONTINUE_PROMPT "-- Продължаване%1%2%3 --%4"
+ IDS_CONTINUE_PERCENT " (%d%%)"
+ IDS_CONTINUE_LINE_AT " [Line: %d]"
+ IDS_CONTINUE_OPTIONS " [Options: psfq=<Space><Enter>]"
+ IDS_CONTINUE_LINES " Lines: "
END
diff --git a/base/applications/cmdutils/more/lang/ca-ES.rc
b/base/applications/cmdutils/more/lang/ca-ES.rc
index f14562e6600..59401c23917 100644
--- a/base/applications/cmdutils/more/lang/ca-ES.rc
+++ b/base/applications/cmdutils/more/lang/ca-ES.rc
@@ -42,11 +42,11 @@ at the ""-- Continue --"" prompt:\n\
<Space> Display the next page.\n\
<Enter> Display the next line.\n"
- IDS_CONTINUE "-- Continua --"
- IDS_CONTINUE_PROGRESS "-- Continua (%d%%) --"
+ IDS_BAD_FLAG "Invalid argument - '%s'\n"
IDS_FILE_ACCESS "No puc accedir al fitxer %s.\n"
- IDS_BAD_FLAG "Invalid argument - '%ls'\n"
- IDS_CONTINUE_OPTIONS "-- Continue (%d%%) [Options:
psfq=<Space><Enter>] --"
- IDS_CONTINUE_LINES "-- Continue (%d%%) -- Lines: "
- IDS_CONTINUE_LINE_AT "-- Continue (%d%%) [Line:%d] --"
+ IDS_CONTINUE_PROMPT "-- Continua%1%2%3 --%4"
+ IDS_CONTINUE_PERCENT " (%d%%)"
+ IDS_CONTINUE_LINE_AT " [Line: %d]"
+ IDS_CONTINUE_OPTIONS " [Options: psfq=<Space><Enter>]"
+ IDS_CONTINUE_LINES " Lines: "
END
diff --git a/base/applications/cmdutils/more/lang/cs-CZ.rc
b/base/applications/cmdutils/more/lang/cs-CZ.rc
index fd1db132622..48fd668ff55 100644
--- a/base/applications/cmdutils/more/lang/cs-CZ.rc
+++ b/base/applications/cmdutils/more/lang/cs-CZ.rc
@@ -48,11 +48,11 @@ at the ""-- Continue --"" prompt:\n\
<Space> Display the next page.\n\
<Enter> Display the next line.\n"
- IDS_CONTINUE "-- Pokračovat --"
- IDS_CONTINUE_PROGRESS "-- Pokračovat (%d%%) --"
+ IDS_BAD_FLAG "Invalid argument - '%s'\n"
IDS_FILE_ACCESS "Nelze získat přístup k souboru %s.\n"
- IDS_BAD_FLAG "Invalid argument - '%ls'\n"
- IDS_CONTINUE_OPTIONS "-- Continue (%d%%) [Options:
psfq=<Space><Enter>] --"
- IDS_CONTINUE_LINES "-- Continue (%d%%) -- Lines: "
- IDS_CONTINUE_LINE_AT "-- Continue (%d%%) [Line:%d] --"
+ IDS_CONTINUE_PROMPT "-- Pokračovat%1%2%3 --%4"
+ IDS_CONTINUE_PERCENT " (%d%%)"
+ IDS_CONTINUE_LINE_AT " [Line: %d]"
+ IDS_CONTINUE_OPTIONS " [Options: psfq=<Space><Enter>]"
+ IDS_CONTINUE_LINES " Lines: "
END
diff --git a/base/applications/cmdutils/more/lang/de-DE.rc
b/base/applications/cmdutils/more/lang/de-DE.rc
index bfa56fcd9df..3fedd6080fd 100644
--- a/base/applications/cmdutils/more/lang/de-DE.rc
+++ b/base/applications/cmdutils/more/lang/de-DE.rc
@@ -42,11 +42,11 @@ at the ""-- Continue --"" prompt:\n\
<Space> Display the next page.\n\
<Enter> Display the next line.\n"
- IDS_CONTINUE "-- Fortsetzung --"
- IDS_CONTINUE_PROGRESS "-- Fortsetzung (%d%%) --"
+ IDS_BAD_FLAG "Invalid argument - '%s'\n"
IDS_FILE_ACCESS "Auf die Datei %s kann nicht zugegriffen werden.\n"
- IDS_BAD_FLAG "Invalid argument - '%ls'\n"
- IDS_CONTINUE_OPTIONS "-- Continue (%d%%) [Options:
psfq=<Space><Enter>] --"
- IDS_CONTINUE_LINES "-- Continue (%d%%) -- Lines: "
- IDS_CONTINUE_LINE_AT "-- Continue (%d%%) [Line:%d] --"
+ IDS_CONTINUE_PROMPT "-- Fortsetzung%1%2%3 --%4"
+ IDS_CONTINUE_PERCENT " (%d%%)"
+ IDS_CONTINUE_LINE_AT " [Line: %d]"
+ IDS_CONTINUE_OPTIONS " [Options: psfq=<Space><Enter>]"
+ IDS_CONTINUE_LINES " Lines: "
END
diff --git a/base/applications/cmdutils/more/lang/el-GR.rc
b/base/applications/cmdutils/more/lang/el-GR.rc
index 6750bbd9317..035b50331b2 100644
--- a/base/applications/cmdutils/more/lang/el-GR.rc
+++ b/base/applications/cmdutils/more/lang/el-GR.rc
@@ -42,11 +42,11 @@ at the ""-- Continue --"" prompt:\n\
<Space> Display the next page.\n\
<Enter> Display the next line.\n"
- IDS_CONTINUE "-- Συνέχεια --"
- IDS_CONTINUE_PROGRESS "-- Συνέχεια (%d%%) --"
+ IDS_BAD_FLAG "Invalid argument - '%s'\n"
IDS_FILE_ACCESS "Δεν ήταν δυνατή η προσπέλαση του αρχείου %s.\n"
- IDS_BAD_FLAG "Invalid argument - '%ls'\n"
- IDS_CONTINUE_OPTIONS "-- Continue (%d%%) [Options:
psfq=<Space><Enter>] --"
- IDS_CONTINUE_LINES "-- Continue (%d%%) -- Lines: "
- IDS_CONTINUE_LINE_AT "-- Continue (%d%%) [Line:%d] --"
+ IDS_CONTINUE_PROMPT "-- Συνέχεια%1%2%3 --%4"
+ IDS_CONTINUE_PERCENT " (%d%%)"
+ IDS_CONTINUE_LINE_AT " [Line: %d]"
+ IDS_CONTINUE_OPTIONS " [Options: psfq=<Space><Enter>]"
+ IDS_CONTINUE_LINES " Lines: "
END
diff --git a/base/applications/cmdutils/more/lang/en-US.rc
b/base/applications/cmdutils/more/lang/en-US.rc
index 5f182d8e173..96f4c543107 100644
--- a/base/applications/cmdutils/more/lang/en-US.rc
+++ b/base/applications/cmdutils/more/lang/en-US.rc
@@ -42,11 +42,11 @@ at the ""-- Continue --"" prompt:\n\
<Space> Display the next page.\n\
<Enter> Display the next line.\n"
- IDS_CONTINUE "-- Continue --"
- IDS_CONTINUE_PROGRESS "-- Continue (%d%%) --"
+ IDS_BAD_FLAG "Invalid argument - '%s'\n"
IDS_FILE_ACCESS "Cannot access the file %s.\n"
- IDS_BAD_FLAG "Invalid argument - '%ls'\n"
- IDS_CONTINUE_OPTIONS "-- Continue (%d%%) [Options:
psfq=<Space><Enter>] --"
- IDS_CONTINUE_LINES "-- Continue (%d%%) -- Lines: "
- IDS_CONTINUE_LINE_AT "-- Continue (%d%%) [Line:%d] --"
+ IDS_CONTINUE_PROMPT "-- Continue%1%2%3 --%4"
+ IDS_CONTINUE_PERCENT " (%d%%)"
+ IDS_CONTINUE_LINE_AT " [Line: %d]"
+ IDS_CONTINUE_OPTIONS " [Options: psfq=<Space><Enter>]"
+ IDS_CONTINUE_LINES " Lines: "
END
diff --git a/base/applications/cmdutils/more/lang/es-ES.rc
b/base/applications/cmdutils/more/lang/es-ES.rc
index d0191aa2557..9a487cf453a 100644
--- a/base/applications/cmdutils/more/lang/es-ES.rc
+++ b/base/applications/cmdutils/more/lang/es-ES.rc
@@ -42,11 +42,11 @@ at the ""-- Continue --"" prompt:\n\
<Space> Display the next page.\n\
<Enter> Display the next line.\n"
- IDS_CONTINUE "-- Continuar --"
- IDS_CONTINUE_PROGRESS "-- Continuar (%d%%) --"
+ IDS_BAD_FLAG "Invalid argument - '%s'\n"
IDS_FILE_ACCESS "No se puede acceder al fichero %s.\n"
- IDS_BAD_FLAG "Invalid argument - '%ls'\n"
- IDS_CONTINUE_OPTIONS "-- Continue (%d%%) [Options:
psfq=<Space><Enter>] --"
- IDS_CONTINUE_LINES "-- Continue (%d%%) -- Lines: "
- IDS_CONTINUE_LINE_AT "-- Continue (%d%%) [Line:%d] --"
+ IDS_CONTINUE_PROMPT "-- Continuar%1%2%3 --%4"
+ IDS_CONTINUE_PERCENT " (%d%%)"
+ IDS_CONTINUE_LINE_AT " [Line: %d]"
+ IDS_CONTINUE_OPTIONS " [Options: psfq=<Space><Enter>]"
+ IDS_CONTINUE_LINES " Lines: "
END
diff --git a/base/applications/cmdutils/more/lang/et-EE.rc
b/base/applications/cmdutils/more/lang/et-EE.rc
index 4ff3b31a452..5c42e17d0d8 100644
--- a/base/applications/cmdutils/more/lang/et-EE.rc
+++ b/base/applications/cmdutils/more/lang/et-EE.rc
@@ -42,11 +42,11 @@ at the ""-- Continue --"" prompt:\n\
<Space> Display the next page.\n\
<Enter> Display the next line.\n"
- IDS_CONTINUE "-- Jätka --"
- IDS_CONTINUE_PROGRESS "-- Jätka (%d%%) --"
+ IDS_BAD_FLAG "Invalid argument - '%s'\n"
IDS_FILE_ACCESS "Ei saa ligi failile %s.\n"
- IDS_BAD_FLAG "Invalid argument - '%ls'\n"
- IDS_CONTINUE_OPTIONS "-- Continue (%d%%) [Options:
psfq=<Space><Enter>] --"
- IDS_CONTINUE_LINES "-- Continue (%d%%) -- Lines: "
- IDS_CONTINUE_LINE_AT "-- Continue (%d%%) [Line:%d] --"
+ IDS_CONTINUE_PROMPT "-- Jätka%1%2%3 --%4"
+ IDS_CONTINUE_PERCENT " (%d%%)"
+ IDS_CONTINUE_LINE_AT " [Line: %d]"
+ IDS_CONTINUE_OPTIONS " [Options: psfq=<Space><Enter>]"
+ IDS_CONTINUE_LINES " Lines: "
END
diff --git a/base/applications/cmdutils/more/lang/fr-FR.rc
b/base/applications/cmdutils/more/lang/fr-FR.rc
index dd774f048eb..e0b59de9db9 100644
--- a/base/applications/cmdutils/more/lang/fr-FR.rc
+++ b/base/applications/cmdutils/more/lang/fr-FR.rc
@@ -44,11 +44,11 @@ disponibles à l'invite ""-- Continuer --""
:\n\
<Espace> Affiche la page suivante.\n\
<Entrée> Affiche la ligne suivante.\n"
- IDS_CONTINUE "-- Continuer --"
- IDS_CONTINUE_PROGRESS "-- Continuer (%d %%) --"
+ IDS_BAD_FLAG "Paramètre invalide - '%s'\n"
IDS_FILE_ACCESS "Impossible d'accéder au fichier %s.\n"
- IDS_BAD_FLAG "Invalid argument - '%ls'\n"
- IDS_CONTINUE_OPTIONS "-- Continue (%d%%) [Options:
psfq=<Space><Enter>] --"
- IDS_CONTINUE_LINES "-- Continue (%d%%) -- Lines: "
- IDS_CONTINUE_LINE_AT "-- Continue (%d%%) [Line:%d] --"
+ IDS_CONTINUE_PROMPT "-- Continuer%1%2%3 --%4"
+ IDS_CONTINUE_PERCENT " (%d %%)"
+ IDS_CONTINUE_LINE_AT " [Ligne : %d]"
+ IDS_CONTINUE_OPTIONS " [Options : psfq=<Espace><Entrée>]"
+ IDS_CONTINUE_LINES " Lignes : "
END
diff --git a/base/applications/cmdutils/more/lang/it-IT.rc
b/base/applications/cmdutils/more/lang/it-IT.rc
index 32eb4497938..7e477fe8c19 100644
--- a/base/applications/cmdutils/more/lang/it-IT.rc
+++ b/base/applications/cmdutils/more/lang/it-IT.rc
@@ -42,11 +42,11 @@ at the ""-- Continue --"" prompt:\n\
<Space> Display the next page.\n\
<Enter> Display the next line.\n"
- IDS_CONTINUE "-- Continua --"
- IDS_CONTINUE_PROGRESS "-- Continua (%d%%) --"
+ IDS_BAD_FLAG "Invalid argument - '%s'\n"
IDS_FILE_ACCESS "Impossibile accedere al file %s.\n"
- IDS_BAD_FLAG "Invalid argument - '%ls'\n"
- IDS_CONTINUE_OPTIONS "-- Continue (%d%%) [Options:
psfq=<Space><Enter>] --"
- IDS_CONTINUE_LINES "-- Continue (%d%%) -- Lines: "
- IDS_CONTINUE_LINE_AT "-- Continue (%d%%) [Line:%d] --"
+ IDS_CONTINUE_PROMPT "-- Continua%1%2%3 --%4"
+ IDS_CONTINUE_PERCENT " (%d%%)"
+ IDS_CONTINUE_LINE_AT " [Line: %d]"
+ IDS_CONTINUE_OPTIONS " [Options: psfq=<Space><Enter>]"
+ IDS_CONTINUE_LINES " Lines: "
END
diff --git a/base/applications/cmdutils/more/lang/lt-LT.rc
b/base/applications/cmdutils/more/lang/lt-LT.rc
index e7b3013a754..0e7979ca472 100644
--- a/base/applications/cmdutils/more/lang/lt-LT.rc
+++ b/base/applications/cmdutils/more/lang/lt-LT.rc
@@ -51,11 +51,11 @@ at the ""-- Continue --"" prompt:\n\
<Space> Display the next page.\n\
<Enter> Display the next line.\n"
- IDS_CONTINUE "-- Toliau --"
- IDS_CONTINUE_PROGRESS "-- Toliau (%d%%) --"
+ IDS_BAD_FLAG "Invalid argument - '%s'\n"
IDS_FILE_ACCESS "Nepavyko atverti bylos %s.\n"
- IDS_BAD_FLAG "Invalid argument - '%ls'\n"
- IDS_CONTINUE_OPTIONS "-- Continue (%d%%) [Options:
psfq=<Space><Enter>] --"
- IDS_CONTINUE_LINES "-- Continue (%d%%) -- Lines: "
- IDS_CONTINUE_LINE_AT "-- Continue (%d%%) [Line:%d] --"
+ IDS_CONTINUE_PROMPT "-- Toliau%1%2%3 --%4"
+ IDS_CONTINUE_PERCENT " (%d%%)"
+ IDS_CONTINUE_LINE_AT " [Line: %d]"
+ IDS_CONTINUE_OPTIONS " [Options: psfq=<Space><Enter>]"
+ IDS_CONTINUE_LINES " Lines: "
END
diff --git a/base/applications/cmdutils/more/lang/no-NO.rc
b/base/applications/cmdutils/more/lang/no-NO.rc
index 6274bd17536..f9396a74663 100644
--- a/base/applications/cmdutils/more/lang/no-NO.rc
+++ b/base/applications/cmdutils/more/lang/no-NO.rc
@@ -42,11 +42,11 @@ at the ""-- Continue --"" prompt:\n\
<Space> Display the next page.\n\
<Enter> Display the next line.\n"
- IDS_CONTINUE "-- Fortsett --"
- IDS_CONTINUE_PROGRESS "-- Fortsett (%d%%) --"
+ IDS_BAD_FLAG "Invalid argument - '%s'\n"
IDS_FILE_ACCESS "Får ikke tilgang til filen %s.\n"
- IDS_BAD_FLAG "Invalid argument - '%ls'\n"
- IDS_CONTINUE_OPTIONS "-- Continue (%d%%) [Options:
psfq=<Space><Enter>] --"
- IDS_CONTINUE_LINES "-- Continue (%d%%) -- Lines: "
- IDS_CONTINUE_LINE_AT "-- Continue (%d%%) [Line:%d] --"
+ IDS_CONTINUE_PROMPT "-- Fortsett%1%2%3 --%4"
+ IDS_CONTINUE_PERCENT " (%d%%)"
+ IDS_CONTINUE_LINE_AT " [Line: %d]"
+ IDS_CONTINUE_OPTIONS " [Options: psfq=<Space><Enter>]"
+ IDS_CONTINUE_LINES " Lines: "
END
diff --git a/base/applications/cmdutils/more/lang/pl-PL.rc
b/base/applications/cmdutils/more/lang/pl-PL.rc
index 9b564b1578c..b10a7c7e9ff 100644
--- a/base/applications/cmdutils/more/lang/pl-PL.rc
+++ b/base/applications/cmdutils/more/lang/pl-PL.rc
@@ -50,11 +50,11 @@ at the ""-- Continue --"" prompt:\n\
<Space> Display the next page.\n\
<Enter> Display the next line.\n"
- IDS_CONTINUE "-- Kontynuuj --"
- IDS_CONTINUE_PROGRESS "-- Kontynuuj (%d%%) --"
+ IDS_BAD_FLAG "Invalid argument - '%s'\n"
IDS_FILE_ACCESS "Brak dostępu do pliku: %s.\n"
- IDS_BAD_FLAG "Invalid argument - '%ls'\n"
- IDS_CONTINUE_OPTIONS "-- Continue (%d%%) [Options:
psfq=<Space><Enter>] --"
- IDS_CONTINUE_LINES "-- Continue (%d%%) -- Lines: "
- IDS_CONTINUE_LINE_AT "-- Continue (%d%%) [Line:%d] --"
+ IDS_CONTINUE_PROMPT "-- Kontynuuj%1%2%3 --%4"
+ IDS_CONTINUE_PERCENT " (%d%%)"
+ IDS_CONTINUE_LINE_AT " [Line: %d]"
+ IDS_CONTINUE_OPTIONS " [Options: psfq=<Space><Enter>]"
+ IDS_CONTINUE_LINES " Lines: "
END
diff --git a/base/applications/cmdutils/more/lang/ro-RO.rc
b/base/applications/cmdutils/more/lang/ro-RO.rc
index 41f25717910..ef4417a6629 100644
--- a/base/applications/cmdutils/more/lang/ro-RO.rc
+++ b/base/applications/cmdutils/more/lang/ro-RO.rc
@@ -50,11 +50,11 @@ at the ""-- Continue --"" prompt:\n\
<Space> Display the next page.\n\
<Enter> Display the next line.\n"
- IDS_CONTINUE "-- Continuă --"
- IDS_CONTINUE_PROGRESS "-- Continuă (%d%%) --"
+ IDS_BAD_FLAG "Invalid argument - '%s'\n"
IDS_FILE_ACCESS "Fișierul «%s» nu poate fi accesat!\n"
- IDS_BAD_FLAG "Invalid argument - '%ls'\n"
- IDS_CONTINUE_OPTIONS "-- Continue (%d%%) [Options:
psfq=<Space><Enter>] --"
- IDS_CONTINUE_LINES "-- Continue (%d%%) -- Lines: "
- IDS_CONTINUE_LINE_AT "-- Continue (%d%%) [Line:%d] --"
+ IDS_CONTINUE_PROMPT "-- Continuă%1%2%3 --%4"
+ IDS_CONTINUE_PERCENT " (%d%%)"
+ IDS_CONTINUE_LINE_AT " [Line: %d]"
+ IDS_CONTINUE_OPTIONS " [Options: psfq=<Space><Enter>]"
+ IDS_CONTINUE_LINES " Lines: "
END
diff --git a/base/applications/cmdutils/more/lang/ru-RU.rc
b/base/applications/cmdutils/more/lang/ru-RU.rc
index 13f2aa219d2..a2ec7e99233 100644
--- a/base/applications/cmdutils/more/lang/ru-RU.rc
+++ b/base/applications/cmdutils/more/lang/ru-RU.rc
@@ -50,11 +50,11 @@ at the ""-- Continue --"" prompt:\n\
<Space> Display the next page.\n\
<Enter> Display the next line.\n"
- IDS_CONTINUE "-- Продолжить --"
- IDS_CONTINUE_PROGRESS "-- Продолжить (%d%%) --"
+ IDS_BAD_FLAG "Invalid argument - '%s'\n"
IDS_FILE_ACCESS "Нет доступа к файлу %s.\n"
- IDS_BAD_FLAG "Invalid argument - '%ls'\n"
- IDS_CONTINUE_OPTIONS "-- Continue (%d%%) [Options:
psfq=<Space><Enter>] --"
- IDS_CONTINUE_LINES "-- Continue (%d%%) -- Lines: "
- IDS_CONTINUE_LINE_AT "-- Continue (%d%%) [Line:%d] --"
+ IDS_CONTINUE_PROMPT "-- Продолжить%1%2%3 --%4"
+ IDS_CONTINUE_PERCENT " (%d%%)"
+ IDS_CONTINUE_LINE_AT " [Line: %d]"
+ IDS_CONTINUE_OPTIONS " [Options: psfq=<Space><Enter>]"
+ IDS_CONTINUE_LINES " Lines: "
END
diff --git a/base/applications/cmdutils/more/lang/sk-SK.rc
b/base/applications/cmdutils/more/lang/sk-SK.rc
index d9c83207ab8..2dc91d241a1 100644
--- a/base/applications/cmdutils/more/lang/sk-SK.rc
+++ b/base/applications/cmdutils/more/lang/sk-SK.rc
@@ -46,11 +46,11 @@ at the ""-- Continue --"" prompt:\n\
<Space> Display the next page.\n\
<Enter> Display the next line.\n"
- IDS_CONTINUE "-- Pokračujte --"
- IDS_CONTINUE_PROGRESS "-- Pokračujte (%d%%) --"
+ IDS_BAD_FLAG "Invalid argument - '%s'\n"
IDS_FILE_ACCESS "Neviem získať prístup k súboru %s.\n"
- IDS_BAD_FLAG "Invalid argument - '%ls'\n"
- IDS_CONTINUE_OPTIONS "-- Continue (%d%%) [Options:
psfq=<Space><Enter>] --"
- IDS_CONTINUE_LINES "-- Continue (%d%%) -- Lines: "
- IDS_CONTINUE_LINE_AT "-- Continue (%d%%) [Line:%d] --"
+ IDS_CONTINUE_PROMPT "-- Pokračujte%1%2%3 --%4"
+ IDS_CONTINUE_PERCENT " (%d%%)"
+ IDS_CONTINUE_LINE_AT " [Line: %d]"
+ IDS_CONTINUE_OPTIONS " [Options: psfq=<Space><Enter>]"
+ IDS_CONTINUE_LINES " Lines: "
END
diff --git a/base/applications/cmdutils/more/lang/sq-AL.rc
b/base/applications/cmdutils/more/lang/sq-AL.rc
index 29b508426bd..9e769002a80 100644
--- a/base/applications/cmdutils/more/lang/sq-AL.rc
+++ b/base/applications/cmdutils/more/lang/sq-AL.rc
@@ -46,11 +46,11 @@ at the ""-- Continue --"" prompt:\n\
<Space> Display the next page.\n\
<Enter> Display the next line.\n"
- IDS_CONTINUE "-- Vazhdo --"
- IDS_CONTINUE_PROGRESS "-- Vazhdo (%d%%) --"
+ IDS_BAD_FLAG "Invalid argument - '%s'\n"
IDS_FILE_ACCESS "Nuk mund të aksesoj dokumentin %s.\n"
- IDS_BAD_FLAG "Invalid argument - '%ls'\n"
- IDS_CONTINUE_OPTIONS "-- Continue (%d%%) [Options:
psfq=<Space><Enter>] --"
- IDS_CONTINUE_LINES "-- Continue (%d%%) -- Lines: "
- IDS_CONTINUE_LINE_AT "-- Continue (%d%%) [Line:%d] --"
+ IDS_CONTINUE_PROMPT "-- Vazhdo%1%2%3 --%4"
+ IDS_CONTINUE_PERCENT " (%d%%)"
+ IDS_CONTINUE_LINE_AT " [Line: %d]"
+ IDS_CONTINUE_OPTIONS " [Options: psfq=<Space><Enter>]"
+ IDS_CONTINUE_LINES " Lines: "
END
diff --git a/base/applications/cmdutils/more/lang/sv-SE.rc
b/base/applications/cmdutils/more/lang/sv-SE.rc
index 5a4e250d8dd..d2149941099 100644
--- a/base/applications/cmdutils/more/lang/sv-SE.rc
+++ b/base/applications/cmdutils/more/lang/sv-SE.rc
@@ -49,11 +49,11 @@ at the ""-- Continue --"" prompt:\n\
<Space> Display the next page.\n\
<Enter> Display the next line.\n"
- IDS_CONTINUE "-- Fortsätt --"
- IDS_CONTINUE_PROGRESS "-- Fortsätt (%d%%) --"
+ IDS_BAD_FLAG "Invalid argument - '%s'\n"
IDS_FILE_ACCESS "Får inte tillgång till filen %s.\n"
- IDS_BAD_FLAG "Invalid argument - '%ls'\n"
- IDS_CONTINUE_OPTIONS "-- Continue (%d%%) [Options:
psfq=<Space><Enter>] --"
- IDS_CONTINUE_LINES "-- Continue (%d%%) -- Lines: "
- IDS_CONTINUE_LINE_AT "-- Continue (%d%%) [Line:%d] --"
+ IDS_CONTINUE_PROMPT "-- Fortsätt%1%2%3 --%4"
+ IDS_CONTINUE_PERCENT " (%d%%)"
+ IDS_CONTINUE_LINE_AT " [Line: %d]"
+ IDS_CONTINUE_OPTIONS " [Options: psfq=<Space><Enter>]"
+ IDS_CONTINUE_LINES " Lines: "
END
diff --git a/base/applications/cmdutils/more/lang/tr-TR.rc
b/base/applications/cmdutils/more/lang/tr-TR.rc
index e0599d0ce26..7e25f173595 100644
--- a/base/applications/cmdutils/more/lang/tr-TR.rc
+++ b/base/applications/cmdutils/more/lang/tr-TR.rc
@@ -44,11 +44,11 @@ at the ""-- Continue --"" prompt:\n\
<Space> Display the next page.\n\
<Enter> Display the next line.\n"
- IDS_CONTINUE "-- Sürdür --"
- IDS_CONTINUE_PROGRESS "-- Sürdür (%%%d) --"
+ IDS_BAD_FLAG "Invalid argument - '%s'\n"
IDS_FILE_ACCESS "%s kütüğüne erişilemiyor.\n"
- IDS_BAD_FLAG "Invalid argument - '%ls'\n"
- IDS_CONTINUE_OPTIONS "-- Continue (%d%%) [Options:
psfq=<Space><Enter>] --"
- IDS_CONTINUE_LINES "-- Continue (%d%%) -- Lines: "
- IDS_CONTINUE_LINE_AT "-- Continue (%d%%) [Line:%d] --"
+ IDS_CONTINUE_PROMPT "-- Sürdür%1%2%3 --%4"
+ IDS_CONTINUE_PERCENT " (%%%d)"
+ IDS_CONTINUE_LINE_AT " [Line: %d]"
+ IDS_CONTINUE_OPTIONS " [Options: psfq=<Space><Enter>]"
+ IDS_CONTINUE_LINES " Lines: "
END
diff --git a/base/applications/cmdutils/more/lang/uk-UA.rc
b/base/applications/cmdutils/more/lang/uk-UA.rc
index c5c131419c4..1363190d32b 100644
--- a/base/applications/cmdutils/more/lang/uk-UA.rc
+++ b/base/applications/cmdutils/more/lang/uk-UA.rc
@@ -49,11 +49,11 @@ at the ""-- Continue --"" prompt:\n\
<Space> Display the next page.\n\
<Enter> Display the next line.\n"
- IDS_CONTINUE "-- Далi --"
- IDS_CONTINUE_PROGRESS "-- Далi (%d%%) --"
+ IDS_BAD_FLAG "Invalid argument - '%s'\n"
IDS_FILE_ACCESS "Не можу отримати доступ до файла %s.\n"
- IDS_BAD_FLAG "Invalid argument - '%ls'\n"
- IDS_CONTINUE_OPTIONS "-- Continue (%d%%) [Options:
psfq=<Space><Enter>] --"
- IDS_CONTINUE_LINES "-- Continue (%d%%) -- Lines: "
- IDS_CONTINUE_LINE_AT "-- Continue (%d%%) [Line:%d] --"
+ IDS_CONTINUE_PROMPT "-- Далi%1%2%3 --%4"
+ IDS_CONTINUE_PERCENT " (%d%%)"
+ IDS_CONTINUE_LINE_AT " [Line: %d]"
+ IDS_CONTINUE_OPTIONS " [Options: psfq=<Space><Enter>]"
+ IDS_CONTINUE_LINES " Lines: "
END
diff --git a/base/applications/cmdutils/more/lang/zh-CN.rc
b/base/applications/cmdutils/more/lang/zh-CN.rc
index 007bb73397b..3797c49574f 100644
--- a/base/applications/cmdutils/more/lang/zh-CN.rc
+++ b/base/applications/cmdutils/more/lang/zh-CN.rc
@@ -44,11 +44,11 @@ at the ""-- Continue --"" prompt:\n\
<Space> Display the next page.\n\
<Enter> Display the next line.\n"
- IDS_CONTINUE "-- 继续 --"
- IDS_CONTINUE_PROGRESS "-- 继续 (%d%%) --"
+ IDS_BAD_FLAG "Invalid argument - '%s'\n"
IDS_FILE_ACCESS "无法访问文件 %s。\n"
- IDS_BAD_FLAG "Invalid argument - '%ls'\n"
- IDS_CONTINUE_OPTIONS "-- Continue (%d%%) [Options:
psfq=<Space><Enter>] --"
- IDS_CONTINUE_LINES "-- Continue (%d%%) -- Lines: "
- IDS_CONTINUE_LINE_AT "-- Continue (%d%%) [Line:%d] --"
+ IDS_CONTINUE_PROMPT "-- 继续%1%2%3 --%4"
+ IDS_CONTINUE_PERCENT " (%d%%)"
+ IDS_CONTINUE_LINE_AT " [Line: %d]"
+ IDS_CONTINUE_OPTIONS " [Options: psfq=<Space><Enter>]"
+ IDS_CONTINUE_LINES " Lines: "
END
diff --git a/base/applications/cmdutils/more/lang/zh-TW.rc
b/base/applications/cmdutils/more/lang/zh-TW.rc
index d246582949d..f6feacb28ca 100644
--- a/base/applications/cmdutils/more/lang/zh-TW.rc
+++ b/base/applications/cmdutils/more/lang/zh-TW.rc
@@ -44,11 +44,11 @@ at the ""-- Continue --"" prompt:\n\
<Space> Display the next page.\n\
<Enter> Display the next line.\n"
- IDS_CONTINUE "-- 繼續 --"
- IDS_CONTINUE_PROGRESS "-- 繼續 (%d%%) --"
+ IDS_BAD_FLAG "Invalid argument - '%s'\n"
IDS_FILE_ACCESS "無法訪問檔案 %s。\n"
- IDS_BAD_FLAG "Invalid argument - '%ls'\n"
- IDS_CONTINUE_OPTIONS "-- Continue (%d%%) [Options:
psfq=<Space><Enter>] --"
- IDS_CONTINUE_LINES "-- Continue (%d%%) -- Lines: "
- IDS_CONTINUE_LINE_AT "-- Continue (%d%%) [Line:%d] --"
+ IDS_CONTINUE_PROMPT "-- 繼續%1%2%3 --%4"
+ IDS_CONTINUE_PERCENT " (%d%%)"
+ IDS_CONTINUE_LINE_AT " [Line: %d]"
+ IDS_CONTINUE_OPTIONS " [Options: psfq=<Space><Enter>]"
+ IDS_CONTINUE_LINES " Lines: "
END
diff --git a/base/applications/cmdutils/more/more.c
b/base/applications/cmdutils/more/more.c
index 5190bc6308c..16c07d2417a 100644
--- a/base/applications/cmdutils/more/more.c
+++ b/base/applications/cmdutils/more/more.c
@@ -32,6 +32,7 @@
#include <winuser.h>
#include <conutils.h>
+#include <strsafe.h>
#include "resource.h"
@@ -51,19 +52,26 @@ HANDLE hKeyboard;
/* Enable/Disable extensions */
BOOL bEnableExtensions = TRUE; // FIXME: By default, it should be FALSE.
-#define FLAG_HELP (1 << 0)
-#define FLAG_E (1 << 1)
-#define FLAG_C (1 << 2)
-#define FLAG_P (1 << 3)
-#define FLAG_S (1 << 4)
-#define FLAG_Tn (1 << 5)
-#define FLAG_PLUSn (1 << 6)
+/* Parser flags */
+#define FLAG_HELP (1 << 0)
+#define FLAG_E (1 << 1)
+#define FLAG_C (1 << 2)
+#define FLAG_P (1 << 3)
+#define FLAG_S (1 << 4)
+#define FLAG_Tn (1 << 5)
+#define FLAG_PLUSn (1 << 6)
+
+/* Prompt flags */
+#define PROMPT_PERCENT (1 << 0)
+#define PROMPT_LINE_AT (1 << 1)
+#define PROMPT_OPTIONS (1 << 2)
+#define PROMPT_LINES (1 << 3)
static DWORD s_dwFlags = 0;
static LONG s_nTabWidth = 8;
static DWORD s_nNextLineNo = 0;
static BOOL s_bPrevLineIsBlank = FALSE;
-static UINT s_nPromptID = IDS_CONTINUE_PROGRESS;
+static WORD s_fPrompt = 0;
static BOOL s_bDoNextFile = FALSE;
static BOOL IsBlankLine(IN PCWCH line, IN DWORD cch)
@@ -143,49 +151,69 @@ PagePrompt(PCON_PAGER Pager, DWORD Done, DWORD Total)
DWORD nLines;
WCHAR chSubCommand = 0;
+ /* Prompt strings (small size since the prompt should
+ * hold ideally on one <= 80-character line) */
+ static WCHAR StrPercent[80] = L"";
+ static WCHAR StrLineAt[80] = L"";
+ static WCHAR StrOptions[80] = L"";
+ static WCHAR StrLines[80] = L"";
+
+ WCHAR szPercent[80] = L"";
+ WCHAR szLineAt[80] = L"";
+
+ /* Load the prompt strings */
+ if (!*StrPercent)
+ K32LoadStringW(NULL, IDS_CONTINUE_PERCENT, StrPercent, ARRAYSIZE(StrPercent));
+ if (!*StrLineAt)
+ K32LoadStringW(NULL, IDS_CONTINUE_LINE_AT, StrLineAt, ARRAYSIZE(StrLineAt));
+ if (!*StrOptions)
+ K32LoadStringW(NULL, IDS_CONTINUE_OPTIONS, StrOptions, ARRAYSIZE(StrOptions));
+ if (!*StrLines)
+ K32LoadStringW(NULL, IDS_CONTINUE_LINES, StrLines, ARRAYSIZE(StrLines));
+
Restart:
nLines = 0;
- /*
- * Just use the simple prompt if the file being displayed is the STDIN,
- * otherwise use the prompt with progress percentage.
- *
- * The progress percentage is evaluated as follows.
- * So far we have read a total of 'dwSumReadBytes' bytes from the file.
- * Amongst those is the latest read chunk of 'dwReadBytes' bytes, to which
- * correspond a number of 'dwReadChars' characters with which we have called
- * ConWritePaging who called PagePrompt. We then have: Total == dwReadChars.
- * During this ConWritePaging call the PagePrompt was called after 'Done'
- * number of characters over 'Total'.
- * It should be noted that for 'dwSumReadBytes' number of bytes read it
- * *roughly* corresponds 'dwSumReadChars' number of characters. This is
- * because there may be some failures happening during the conversion of
- * the bytes read to the character string for a given encoding.
- * Therefore the number of characters displayed on screen is equal to:
- * dwSumReadChars - Total + Done ,
- * but the best corresponding approximed number of bytes would be:
- * dwSumReadBytes - (Total - Done) * (dwSumReadBytes / dwSumReadChars) ,
- * where the ratio is the average number of bytes per character.
- * The percentage is then computed relative to the total file size.
- */
- if (hFile == hStdIn)
- {
- ConResPuts(Pager->Screen->Stream, IDS_CONTINUE);
- }
- else
+ /* Do not show the progress percentage when STDIN is being displayed */
+ if (s_fPrompt & PROMPT_PERCENT) // && (hFile != hStdIn)
{
+ /*
+ * The progress percentage is evaluated as follows.
+ * So far we have read a total of 'dwSumReadBytes' bytes from the file.
+ * Amongst those is the latest read chunk of 'dwReadBytes' bytes, to
which
+ * correspond a number of 'dwReadChars' characters with which we have
called
+ * ConWritePaging who called PagePrompt. We then have: Total == dwReadChars.
+ * During this ConWritePaging call the PagePrompt was called after
'Done'
+ * number of characters over 'Total'.
+ * It should be noted that for 'dwSumReadBytes' number of bytes read it
+ * *roughly* corresponds 'dwSumReadChars' number of characters. This is
+ * because there may be some failures happening during the conversion of
+ * the bytes read to the character string for a given encoding.
+ * Therefore the number of characters displayed on screen is equal to:
+ * dwSumReadChars - Total + Done ,
+ * but the best corresponding approximed number of bytes would be:
+ * dwSumReadBytes - (Total - Done) * (dwSumReadBytes / dwSumReadChars) ,
+ * where the ratio is the average number of bytes per character.
+ * The percentage is then computed relative to the total file size.
+ */
DWORD dwPercent = (dwSumReadBytes - (Total - Done) *
(dwSumReadBytes / dwSumReadChars)) * 100 / dwFileSize;
- if (s_nPromptID == IDS_CONTINUE_LINE_AT)
- {
- ConResPrintf(Pager->Screen->Stream, s_nPromptID, dwPercent,
Pager->lineno);
- }
- else
- {
- ConResPrintf(Pager->Screen->Stream, s_nPromptID, dwPercent);
- }
+ StringCchPrintfW(szPercent, ARRAYSIZE(szPercent), StrPercent, dwPercent);
}
- s_nPromptID = IDS_CONTINUE_PROGRESS;
+ if (s_fPrompt & PROMPT_LINE_AT)
+ {
+ StringCchPrintfW(szLineAt, ARRAYSIZE(szLineAt), StrLineAt, Pager->lineno);
+ }
+
+ /* Suitably format and display the prompt */
+ ConResMsgPrintf(Pager->Screen->Stream, 0, IDS_CONTINUE_PROMPT,
+ (s_fPrompt & PROMPT_PERCENT ? szPercent : L""),
+ (s_fPrompt & PROMPT_LINE_AT ? szLineAt : L""),
+ (s_fPrompt & PROMPT_OPTIONS ? StrOptions : L""),
+ (s_fPrompt & PROMPT_LINES ? StrLines : L""));
+
+ /* Reset the prompt to a default state */
+ s_fPrompt &= ~(PROMPT_LINE_AT | PROMPT_OPTIONS | PROMPT_LINES);
/* RemoveBreakHandler */
SetConsoleCtrlHandler(NULL, TRUE);
@@ -364,7 +392,7 @@ Restart:
/* '?': Show Options */
if (KeyEvent.uChar.UnicodeChar == L'?')
{
- s_nPromptID = IDS_CONTINUE_OPTIONS;
+ s_fPrompt |= PROMPT_OPTIONS;
goto Restart;
}
@@ -389,7 +417,7 @@ Restart:
/* 'P': Display n lines */
if (KeyEvent.wVirtualKeyCode == L'P')
{
- s_nPromptID = IDS_CONTINUE_LINES;
+ s_fPrompt |= PROMPT_LINES;
chSubCommand = L'P';
goto Restart;
}
@@ -397,7 +425,7 @@ Restart:
/* 'S': Skip n lines */
if (KeyEvent.wVirtualKeyCode == L'S')
{
- s_nPromptID = IDS_CONTINUE_LINES;
+ s_fPrompt |= PROMPT_LINES;
chSubCommand = L'S';
goto Restart;
}
@@ -405,11 +433,10 @@ Restart:
/* '=': Show current line number */
if (KeyEvent.uChar.UnicodeChar == L'=')
{
- s_nPromptID = IDS_CONTINUE_LINE_AT;
+ s_fPrompt |= PROMPT_LINE_AT;
goto Restart;
}
- s_nPromptID = IDS_CONTINUE_PROGRESS;
chSubCommand = 0;
goto Restart;
}
@@ -1048,7 +1075,7 @@ int wmain(int argc, WCHAR* argv[])
/* Reset state for paging */
s_bPrevLineIsBlank = FALSE;
- s_nPromptID = IDS_CONTINUE_PROGRESS;
+ s_fPrompt = PROMPT_PERCENT;
s_bDoNextFile = FALSE;
/* Update the statistics for PagePrompt */
diff --git a/base/applications/cmdutils/more/resource.h
b/base/applications/cmdutils/more/resource.h
index b477bcc0847..98a66e204ca 100644
--- a/base/applications/cmdutils/more/resource.h
+++ b/base/applications/cmdutils/more/resource.h
@@ -1,10 +1,11 @@
#pragma once
#define IDS_USAGE 100
-#define IDS_CONTINUE 101
-#define IDS_CONTINUE_PROGRESS 102
-#define IDS_FILE_ACCESS 103
-#define IDS_BAD_FLAG 104
-#define IDS_CONTINUE_OPTIONS 105
-#define IDS_CONTINUE_LINES 106
-#define IDS_CONTINUE_LINE_AT 107
+#define IDS_BAD_FLAG 101
+#define IDS_FILE_ACCESS 102
+
+#define IDS_CONTINUE_PROMPT 110
+#define IDS_CONTINUE_PERCENT 111
+#define IDS_CONTINUE_LINE_AT 112
+#define IDS_CONTINUE_OPTIONS 113
+#define IDS_CONTINUE_LINES 114