[gnome-control-center] printers: avoid crashes when searching for printers w/ special chars



commit ac6b1acc1f6972e79776fb5d7f5b85d06fbc8cb7
Author: Felipe Borges <feborges redhat com>
Date:   Thu Sep 3 13:16:37 2015 +0200

    printers: avoid crashes when searching for printers w/ special chars
    
    Since the dialog considers just  the hostname part from the URL,
    unespacing the url avoids a backend crash.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=754248

 panels/printers/pp-new-printer-dialog.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/panels/printers/pp-new-printer-dialog.c b/panels/printers/pp-new-printer-dialog.c
index e74cc65..cdedd7e 100644
--- a/panels/printers/pp-new-printer-dialog.c
+++ b/panels/printers/pp-new-printer-dialog.c
@@ -1386,7 +1386,11 @@ parse_uri (const gchar  *uri,
       *port = atoi (position + 1);
     }
 
-  *host = resulting_host;
+  *host = g_uri_unescape_string (resulting_host,
+                                 G_URI_RESERVED_CHARS_GENERIC_DELIMITERS
+                                 G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS);
+
+  g_free (resulting_host);
 
   return TRUE;
 }


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