ooo-build r12044 - in trunk: . scratch



Author: tml
Date: Fri Mar 28 17:28:18 2008
New Revision: 12044
URL: http://svn.gnome.org/viewvc/ooo-build?rev=12044&view=rev

Log:
2008-03-28  Tor Lillqvist  <tml novell com>

	* scratch/setup-wrapper.c: Quote argv1 when calling _wspawnl() in
	case it contains spaces. (Not that it seems to help in running the
	installation from a network drive, sigh.)



Modified:
   trunk/ChangeLog
   trunk/scratch/setup-wrapper.c

Modified: trunk/scratch/setup-wrapper.c
==============================================================================
--- trunk/scratch/setup-wrapper.c	(original)
+++ trunk/scratch/setup-wrapper.c	Fri Mar 28 17:28:18 2008
@@ -25,6 +25,21 @@
 static LANGID system_ui_lang;
 static LANGID user_ui_lang;
 
+static int
+run (wchar_t *program)
+{
+  wchar_t quoted_program[1000];
+
+  if (GetFileAttributesW (program) == INVALID_FILE_ATTRIBUTES)
+    return -1;
+
+  wcscpy (quoted_program, L"\"");
+  wcscat (quoted_program, program);
+  wcscat (quoted_program, L"\"");
+      
+  return _wspawnl (_P_WAIT, program, quoted_program, NULL);
+}
+
 static void
 try_langpack (LANGID langid)
 {
@@ -47,8 +62,7 @@
       wcscat (langpack_setup, locale);
       wcscat (langpack_setup, L"/setup.exe");
 
-      if (GetFileAttributesW (langpack_setup) != INVALID_FILE_ATTRIBUTES)
-        _wspawnl (_P_WAIT, langpack_setup, langpack_setup, NULL);
+      run (langpack_setup);
     }
 
   /* Then try just the language */
@@ -59,8 +73,7 @@
       wcscat (langpack_setup, locale);
       wcscat (langpack_setup, L"/setup.exe");
 
-      if (GetFileAttributesW (langpack_setup) != INVALID_FILE_ATTRIBUTES)
-        _wspawnl (_P_WAIT, langpack_setup, langpack_setup, NULL);
+      run (langpack_setup);
     }
 }
 
@@ -107,7 +120,7 @@
   wcscpy (base_setup, path);
   wcscat (base_setup, L"base/setup.exe");
 
-  rc =_wspawnl (_P_WAIT, base_setup, base_setup, NULL);
+  rc = run (base_setup);
 
   if (rc != 0)
     exit (1);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]