Fixed args passing with blanks for Windows Service
authorAdam Dickmeiss <adam@indexdata.dk>
Fri, 6 Mar 2009 14:34:48 +0000 (15:34 +0100)
committerAdam Dickmeiss <adam@indexdata.dk>
Fri, 6 Mar 2009 14:34:48 +0000 (15:34 +0100)
src/sc.c

index 277b8d9..e0c1ec1 100644 (file)
--- a/src/sc.c
+++ b/src/sc.c
@@ -268,7 +268,11 @@ int yaz_sc_program(yaz_sc_t s, int argc, char **argv,
             for (i = 1; i < argc; i++)
             {
                 wrbuf_puts(w, " ");
+                if (strchr(argv[i], ' '))
+                    wrbuf_puts(w, "\"");
                 wrbuf_puts(w, argv[i]);
+                if (strchr(argv[i], ' '))
+                    wrbuf_puts(w, "\"");
             }
             wrbuf_puts(w, " -run \"");
             wrbuf_puts(w, cwdstr);