]> www.fi.muni.cz Git - evince.git/commitdiff
Missing null check
authorMarco Pesenti Gritti <mpg@redhat.com>
Mon, 19 Sep 2005 10:39:13 +0000 (10:39 +0000)
committerMarco Pesenti Gritti <marco@src.gnome.org>
Mon, 19 Sep 2005 10:39:13 +0000 (10:39 +0000)
2005-09-19  Marco Pesenti Gritti  <mpg@redhat.com>

        * shell/ev-window-title.c: (ev_window_title_set_document):

        Missing null check

ChangeLog
shell/ev-window-title.c

index c0c38ff9c3dd4658afcebabe997f31a72e6dfbdb..e3da7bdd180904f3b2ed8dce6dfad687b70e0009 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-09-19  Marco Pesenti Gritti  <mpg@redhat.com>
+
+       * shell/ev-window-title.c: (ev_window_title_set_document):
+
+       Missing null check
+
 2005-09-17  Nickolay V. Shmyrev  <nshmyrev@yandex.ru>
 
        * shell/ev-view.c: (view_update_range_and_current_page):
index 787c585e74e3057be0485b2d2bb44e5d07ad5cdd..cfa013e270f8d38df081a85b3dcfda49708d8fee 100644 (file)
@@ -122,25 +122,25 @@ ev_window_title_set_document (EvWindowTitle *window_title,
                window_title->title = g_strdup (title);
        }
 
-       /* Some docs report titles with confusing extensions (ex. .doc for pdf).
-           Let's show the filename in this case */
-       for (i = 0; i < G_N_ELEMENTS (bad_extensions); i++) {
-               if (bad_extensions[i].backend == ev_document_factory_get_backend (document) &&
-                   g_str_has_suffix (window_title->title, bad_extensions[i].ext)) {
-                       char *new_title;
-                       char *filename = get_filename_from_uri (uri);
-
-                       new_title = g_strdup_printf ("%s (%s)", window_title->title, filename);
-                       g_free (window_title->title);
-                       window_title->title = new_title;
-
-                       g_free (filename);
-               }
-       } 
-
        if (window_title->title) {
                char *p;
 
+               /* Some docs report titles with confusing extensions (ex. .doc for pdf).
+                  Let's show the filename in this case */
+               for (i = 0; i < G_N_ELEMENTS (bad_extensions); i++) {
+                       if (bad_extensions[i].backend == ev_document_factory_get_backend (document) &&
+                           g_str_has_suffix (window_title->title, bad_extensions[i].ext)) {
+                               char *new_title;
+                               char *filename = get_filename_from_uri (uri);
+
+                               new_title = g_strdup_printf ("%s (%s)", window_title->title, filename);
+                               g_free (window_title->title);
+                               window_title->title = new_title;
+
+                               g_free (filename);
+                       }
+               }
+
                for (p = window_title->title; *p; ++p) {
                        /* an '\n' byte is always ASCII, no need for UTF-8 special casing */
                        if (*p == '\n')