]> www.fi.muni.cz Git - evince.git/commitdiff
Correctly quote symbols. Fixes crash in the bug #415370.
authorNickolay V. Shmyrev <nshmyrev@yandex.ru>
Wed, 9 May 2007 22:27:29 +0000 (22:27 +0000)
committerNickolay V. Shmyrev <nshmyrev@src.gnome.org>
Wed, 9 May 2007 22:27:29 +0000 (22:27 +0000)
2007-05-10  Nickolay V. Shmyrev  <nshmyrev@yandex.ru>

* backend/comics/comics-document.c: (comics_regex_quote),
(extract_argv):

Correctly quote symbols. Fixes crash in the bug
#415370.

svn path=/trunk/; revision=2446

ChangeLog
backend/comics/comics-document.c

index 0cc791fedfff0d928de5a131f1be9cecf9c1b217..ace5fe92c5b3ae6fc19a95d55bb6657388375c48 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-05-10  Nickolay V. Shmyrev  <nshmyrev@yandex.ru>
+
+       * backend/comics/comics-document.c: (comics_regex_quote),
+       (extract_argv):
+       
+       Correctly quote symbols. Fixes crash in the bug
+       #415370.
+
 2007-05-10  Nickolay V. Shmyrev  <nshmyrev@yandex.ru>
 
        * shell/ev-navigation-action-widget.c:
index e0fdd31ef781b0223b05afa746cbf11001efede9..64bd2b75eabaaa9f301e7db13b5a03321c1d5d75 100644 (file)
@@ -72,7 +72,7 @@ comics_regex_quote (const char *s)
 {
     char *ret, *d;
 
-    d = ret = g_malloc (strlen (s) * 2 + 3);
+    d = ret = g_malloc (strlen (s) * 4 + 3);
     
     *d++ = '\'';
 
@@ -85,7 +85,9 @@ comics_regex_quote (const char *s)
        case '*':
        case '\\':
        case '\'':
+           *d++ = '\'';
            *d++ = '\\';
+           *d++ = '\'';
            break;
        }
        *d = *s;
@@ -461,6 +463,7 @@ extract_argv (EvDocument *document, gint page)
        ComicsDocument *comics_document = COMICS_DOCUMENT (document);
        char **argv;
        char *command_line, *quoted_archive, *quoted_filename;
+       GError *err = NULL;
 
        quoted_archive = g_shell_quote (comics_document->archive);
        if (comics_document->regex_arg) {
@@ -475,8 +478,14 @@ extract_argv (EvDocument *document, gint page)
                                        comics_document->extract_command,
                                        quoted_archive,
                                        quoted_filename);
-       g_shell_parse_argv (command_line, NULL, &argv, NULL);
 
+       g_shell_parse_argv (command_line, NULL, &argv, &err);
+       
+       if (err) {
+               g_warning ("Error %s", err->message);
+               return NULL;
+       }
+       
        g_free (command_line);
        g_free (quoted_archive);
        g_free (quoted_filename);