Quote filenames
[platform/upstream/corewatcher.git] / src / coredump.c
index 4c84610..a378eea 100644 (file)
@@ -225,7 +225,7 @@ static struct oops *extract_core(char *fullpath, char *appfile, char *reportname
 
        fprintf(stderr, "+ extract_core() called for %s\n", fullpath);
 
-       if (asprintf(&command, "LANG=C gdb --batch -f %s %s -x /etc/corewatcher/gdb.command 2> /dev/null", appfile, fullpath) == -1)
+       if (asprintf(&command, "LANG=C gdb --batch -f '%s' '%s' -x /etc/corewatcher/gdb.command 2> /dev/null", appfile, fullpath) == -1)
                return NULL;
 
        file = popen(command, "r");
@@ -326,8 +326,8 @@ static struct oops *extract_core(char *fullpath, char *appfile, char *reportname
                       "maps: |\n"
                       "%s",
                       h1,
-                      c1 ? c1 : "        Unknown",
-                      m1 ? m1 : "        Unknown");
+                      c1 ? c1 : "        Unknown\n",
+                      m1 ? m1 : "        Unknown\n");
        free(h1);
        if (c1)
                free(c1);