[3/4] cmd: Reduce the scope of a global variable

Frédéric Delanoy frederic.delanoy at gmail.com
Tue Nov 29 07:39:27 CST 2011


---
 programs/cmd/wcmdmain.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c
index 719f17a..3966b29 100644
--- a/programs/cmd/wcmdmain.c
+++ b/programs/cmd/wcmdmain.c
@@ -45,16 +45,17 @@ WCHAR quals[MAX_PATH], param1[MAXSTRING], param2[MAXSTRING];
 BATCH_CONTEXT *context = NULL;
 extern struct env_stack *pushd_directories;
 static const WCHAR *pagedMessage = NULL;
-static char  *output_bufA = NULL;
-#define MAX_WRITECONSOLE_SIZE 65535
 static BOOL unicodePipes = FALSE;
 
+#define MAX_WRITECONSOLE_SIZE 65535
+
 /*
  * Returns a buffer for reading from/writing to file
  * Never freed
  */
 static char *get_file_buffer(void)
 {
+    static char *output_bufA = NULL;
     if (!output_bufA) {
         output_bufA = HeapAlloc(GetProcessHeap(), 0, MAX_WRITECONSOLE_SIZE);
         if (!output_bufA)
-- 
1.7.7.2




More information about the wine-patches mailing list