Fixed args passing with blanks for Windows Service
[yaz-moved-to-github.git] / src / sc.c
index 3eb6e12..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, " ");
             for (i = 1; i < argc; i++)
             {
                 wrbuf_puts(w, " ");
+                if (strchr(argv[i], ' '))
+                    wrbuf_puts(w, "\"");
                 wrbuf_puts(w, argv[i]);
                 wrbuf_puts(w, argv[i]);
+                if (strchr(argv[i], ' '))
+                    wrbuf_puts(w, "\"");
             }
             wrbuf_puts(w, " -run \"");
             wrbuf_puts(w, cwdstr);
             }
             wrbuf_puts(w, " -run \"");
             wrbuf_puts(w, cwdstr);
@@ -373,6 +377,7 @@ void yaz_sc_destroy(yaz_sc_t *s)
 /*
  * Local variables:
  * c-basic-offset: 4
 /*
  * Local variables:
  * c-basic-offset: 4
+ * c-file-style: "Stroustrup"
  * indent-tabs-mode: nil
  * End:
  * vim: shiftwidth=4 tabstop=8 expandtab
  * indent-tabs-mode: nil
  * End:
  * vim: shiftwidth=4 tabstop=8 expandtab