]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
extension for spawn_parse_args - parse \b \f \n \r \t
authorJaroslav Kysela <perex@perex.cz>
Thu, 29 Oct 2015 16:32:42 +0000 (17:32 +0100)
committerJaroslav Kysela <perex@perex.cz>
Thu, 29 Oct 2015 16:36:21 +0000 (17:36 +0100)
src/spawn.c

index a12004db3a7f769a3859904d8049c08dc8afb6bd..1aae187c77d8e8f924aa449ab31ae5c454389415 100644 (file)
@@ -364,7 +364,22 @@ spawn_parse_args(char ***argv, int argc, const char *cmd, const char **replace)
       while (*s && *s != ' ' && *s != '\\')
         s++;
       if (*s == '\\') {
-        memmove(s, s + 1, strlen(s));
+        l = *(s + 1);
+        if (l == 'b')
+          l = '\b';
+        else if (l == 'f')
+          l = '\f';
+        else if (l == 'n')
+          l = '\n';
+        else if (l == 'r')
+          l = '\r';
+        else if (l == 't')
+          l = '\t';
+        else
+          l = 0;
+        if (l)
+          *s++ = l;
+        memmove(s, s + 1, strlen(s) - 1);
         if (*s)
           s++;
       }