[libgxps] gxps-page: Fix parsing of dash array when it has trailing or leading whitespaces



commit 95c165c2161ed30b1a5ac53b62980f76909dcc6d
Author: Lukas Lueg <lukas lueg gmail com>
Date:   Tue Nov 26 09:12:48 2013 +0100

    gxps-page: Fix parsing of dash array when it has trailing or leading whitespaces
    
    Strip the string before splitting it.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=715023

 libgxps/gxps-page.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/libgxps/gxps-page.c b/libgxps/gxps-page.c
index c1dfb7e..059d1fd 100644
--- a/libgxps/gxps-page.c
+++ b/libgxps/gxps-page.c
@@ -206,11 +206,14 @@ gxps_dash_array_parse (const gchar *dash,
                       guint       *num_dashes_out)
 {
        gchar  **items;
+        gchar   *stripped_dash;
        guint    i;
         gdouble *dashes;
         guint    num_dashes;
 
-       items = g_strsplit (dash, " ", -1);
+        stripped_dash = g_strstrip (g_strdup (dash));
+       items = g_strsplit (stripped_dash, " ", -1);
+        g_free (stripped_dash);
        if (!items)
                return FALSE;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]