Francois Gouget : cmd: Use WCMD_output_asis*() for strings that are not supposed to contain formating directives.

Alexandre Julliard julliard at winehq.org
Fri Nov 25 10:27:34 CST 2011


Module: wine
Branch: master
Commit: 3b729284644c4183958735009f328ca9ea1d0ba7
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=3b729284644c4183958735009f328ca9ea1d0ba7

Author: Francois Gouget <fgouget at free.fr>
Date:   Thu Nov 24 00:30:23 2011 +0100

cmd: Use WCMD_output_asis*() for strings that are not supposed to contain formating directives.

---

 programs/cmd/builtins.c  |   12 ++++++------
 programs/cmd/directory.c |   10 +++++-----
 programs/cmd/wcmdmain.c  |    2 +-
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c
index 6703cef..5197297 100644
--- a/programs/cmd/builtins.c
+++ b/programs/cmd/builtins.c
@@ -361,7 +361,7 @@ void WCMD_choice (const WCHAR * command) {
         ptr = strchrW(opt_c, answer[0]);
         if (ptr) {
             WCMD_output_asis(answer);
-            WCMD_output(newline);
+            WCMD_output_asis(newline);
             if (have_console)
                 SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), oldmode);
 
@@ -964,7 +964,7 @@ void WCMD_echo (const WCHAR *command)
     echo_mode = FALSE;
   else {
     WCMD_output_asis (command);
-    WCMD_output (newline);
+    WCMD_output_asis (newline);
   }
   HeapFree(GetProcessHeap(), 0, trimmed);
 }
@@ -1777,7 +1777,7 @@ void WCMD_pause (void)
   if (have_console)
       SetConsoleMode(hIn, 0);
 
-  WCMD_output(anykey);
+  WCMD_output_asis(anykey);
   WCMD_ReadFile(hIn, &key, 1, &count);
   if (have_console)
     SetConsoleMode(hIn, oldmode);
@@ -2114,7 +2114,7 @@ void WCMD_setshow_default (const WCHAR *command) {
   GetCurrentDirectoryW(sizeof(cwd)/sizeof(WCHAR), cwd);
   if (strlenW(command) == 0) {
     strcatW (cwd, newline);
-    WCMD_output (cwd);
+    WCMD_output_asis (cwd);
   }
   else {
     /* Remove any double quotes, which may be in the
@@ -2325,7 +2325,7 @@ void WCMD_setshow_env (WCHAR *s) {
 
     /* Output the prompt */
     *p++ = '\0';
-    if (strlenW(p) != 0) WCMD_output(p);
+    if (strlenW(p) != 0) WCMD_output_asis(p);
 
     /* Read the reply */
     WCMD_ReadFile(GetStdHandle(STD_INPUT_HANDLE), string, sizeof(string)/sizeof(WCHAR), &count);
@@ -2697,7 +2697,7 @@ void WCMD_verify (const WCHAR *command) {
 
 void WCMD_version (void) {
 
-  WCMD_output (version_string);
+  WCMD_output_asis (version_string);
 
 }
 
diff --git a/programs/cmd/directory.c b/programs/cmd/directory.c
index 03cb952..a5447f5 100644
--- a/programs/cmd/directory.c
+++ b/programs/cmd/directory.c
@@ -326,7 +326,7 @@ static DIRECTORY_STACK *WCMD_list_directory (DIRECTORY_STACK *inputparms, int le
 
     /* Output the results */
     if (!bare) {
-       if (level != 0 && (entry_count > 0)) WCMD_output (newline);
+       if (level != 0 && (entry_count > 0)) WCMD_output_asis (newline);
        if (!recurse || ((entry_count > 0) && done_header==FALSE)) {
            static const WCHAR headerW[] = {'D','i','r','e','c','t','o','r','y',' ','o','f',
                                            ' ','%','s','\n','\n','\0'};
@@ -430,13 +430,13 @@ static DIRECTORY_STACK *WCMD_list_directory (DIRECTORY_STACK *inputparms, int le
                 strcatW(&temp[toWrite], space);
                 toWrite++;
                 if (toWrite > 99) {
-                    WCMD_output(temp);
+                    WCMD_output_asis(temp);
                     toWrite = 0;
                     strcpyW(temp, nullW);
                 }
                 padding--;
             }
-            WCMD_output(temp);
+            WCMD_output_asis(temp);
         }
 
       } else if ((fd+i)->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
@@ -472,7 +472,7 @@ static DIRECTORY_STACK *WCMD_list_directory (DIRECTORY_STACK *inputparms, int le
         }
       }
      }
-     if (addNewLine) WCMD_output (newline);
+     if (addNewLine) WCMD_output_asis (newline);
      cur_width = 0;
     }
 
@@ -949,7 +949,7 @@ void WCMD_directory (WCHAR *cmd)
       }
     } else {
       static const WCHAR newLine2[] = {'\n','\n','\0'};
-      if (!bare) WCMD_output (newLine2);
+      if (!bare) WCMD_output_asis (newLine2);
     }
 
     /* Clear any errors from previous invocations, and process it */
diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c
index 090a6f1..5bcdbca 100644
--- a/programs/cmd/wcmdmain.c
+++ b/programs/cmd/wcmdmain.c
@@ -1512,7 +1512,7 @@ void WCMD_execute (const WCHAR *command, const WCHAR *redirects,
         WCMD_type (p);
 	break;
       case WCMD_VER:
-        WCMD_output(newline);
+        WCMD_output_asis(newline);
         WCMD_version ();
         break;
       case WCMD_VERIFY:




More information about the wine-cvs mailing list