]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
fix spawn_parse_args() - for latest change
authorJaroslav Kysela <perex@perex.cz>
Thu, 29 Oct 2015 18:49:17 +0000 (19:49 +0100)
committerJaroslav Kysela <perex@perex.cz>
Thu, 29 Oct 2015 18:49:17 +0000 (19:49 +0100)
src/spawn.c

index 4e3825c724c2a94a5e02e56a98332fc4b698ca65..f8041a320b796a98c5b5c960061c512a6f181bb4 100644 (file)
@@ -374,8 +374,6 @@ spawn_parse_args(char ***argv, int argc, const char *cmd, const char **replace)
       s++;
     f = s;
     while (*s && *s != ' ') {
-      while (*s && *s != ' ' && *s != '\\')
-        s++;
       if (*s == '\\') {
         l = *(s + 1);
         if (l == 'b')
@@ -390,11 +388,16 @@ spawn_parse_args(char ***argv, int argc, const char *cmd, const char **replace)
           l = '\t';
         else
           l = 0;
-        if (l)
+        if (l) {
           *s++ = l;
-        memmove(s, s + 1, strlen(s) - 1);
-        if (*s)
-          s++;
+          memmove(s, s + 1, strlen(s));
+        } else {
+          memmove(s, s + 1, strlen(s));
+          if (*s)
+            s++;
+        }
+      } else {
+        s++;
       }
     }
     if (f != s) {