]> spindle.queued.net Git - midori/commitdiff
Strip leading and trailing whitespace when parsing user scripts/ style
authorPaweł Forysiuk <tuxator@o2.pl>
Sat, 12 Feb 2011 15:04:36 +0000 (16:04 +0100)
committerChristian Dywan <christian@twotoasts.de>
Sat, 12 Feb 2011 15:40:57 +0000 (16:40 +0100)
extensions/addons.c

index 74ff22c902752be1ec3cdd8c7d88a808bed376c9..4cef9869a61b9a0c5317eb99e3fe4ec28a73fcec 100644 (file)
@@ -937,6 +937,7 @@ js_metadata_from_file (const gchar* filename,
     while (g_io_channel_read_line (channel, &line, NULL, NULL, NULL)
            == G_IO_STATUS_NORMAL)
     {
+        g_strstrip (line);
         if (g_str_has_prefix (line, "// ==UserScript=="))
             found_meta = TRUE;
         else if (found_meta)
@@ -1011,6 +1012,7 @@ css_metadata_from_file (const gchar* filename,
     while (g_io_channel_read_line (channel, &line, NULL, NULL, NULL)
            == G_IO_STATUS_NORMAL)
     {
+        g_strstrip (line);
         if (g_str_has_prefix (line, "@-moz-document") || line_has_meta)
         { /* FIXME: We merely look for includes. We should honor blocks. */
              if (includes)