cmd: Display a clearer error message for not found commands

Frédéric Delanoy frederic.delanoy at gmail.com
Fri Oct 26 06:47:52 CDT 2012


Bug 31875
---
 programs/cmd/cmd.rc     | 1 +
 programs/cmd/wcmd.h     | 1 +
 programs/cmd/wcmdmain.c | 2 +-
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/programs/cmd/cmd.rc b/programs/cmd/cmd.rc
index 6e63936..76f1bca 100644
--- a/programs/cmd/cmd.rc
+++ b/programs/cmd/cmd.rc
@@ -353,4 +353,5 @@ Enter HELP <command> for further information on any of the above commands.\n"
   WCMD_VOLUMENOLABEL, "Volume in drive %1!c! has no label.\n"
   WCMD_YESNO, " (Yes|No)"
   WCMD_YESNOALL, " (Yes|No|All)"
+  WCMD_NO_COMMAND_FOUND, "Can't recognize '%1' as an internal or external command, or batch script.\n"
 }
diff --git a/programs/cmd/wcmd.h b/programs/cmd/wcmd.h
index 26b89c6..c8eefc4 100644
--- a/programs/cmd/wcmd.h
+++ b/programs/cmd/wcmd.h
@@ -286,3 +286,4 @@ extern WCHAR version_string[];
 #define WCMD_VOLUMENOLABEL    1037
 #define WCMD_YESNO            1038
 #define WCMD_YESNOALL         1039
+#define WCMD_NO_COMMAND_FOUND 1040
diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c
index 4e6305a..9045487 100644
--- a/programs/cmd/wcmdmain.c
+++ b/programs/cmd/wcmdmain.c
@@ -1231,7 +1231,7 @@ void WCMD_run_program (WCHAR *command, BOOL called)
 
   /* Not found anywhere - give up */
   SetLastError(ERROR_FILE_NOT_FOUND);
-  WCMD_print_error ();
+  WCMD_output_stderr(WCMD_LoadMessage(WCMD_NO_COMMAND_FOUND), command);
 
   /* If a command fails to launch, it sets errorlevel 9009 - which
      does not seem to have any associated constant definition     */
-- 
1.8.0




More information about the wine-patches mailing list