[virt-viewer 3/3] Clean-up spaces before/after URI in connection dialog

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

 



When starting remote-viewer with no argument, a connection dialog
is shown. If the URI the user types in this dialog as trailing
or leading spaces, then connection will fail because remote-viewer
will keep them as if they were significant.
This commit makes sure we remove spaces at the beginning/end of
the URI before trying to use it.

This fixes https://bugzilla.redhat.com/show_bug.cgi?id=1024199
---
 src/remote-viewer.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/remote-viewer.c b/src/remote-viewer.c
index 936a023..f7c7691 100644
--- a/src/remote-viewer.c
+++ b/src/remote-viewer.c
@@ -991,6 +991,7 @@ connect_dialog(gchar **uri)
     gtk_widget_show_all(dialog);
     if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) {
         *uri = g_strdup(gtk_entry_get_text(GTK_ENTRY(entry)));
+        g_strstrip(*uri);
         retval = 0;
     } else {
         *uri = NULL;
-- 
1.8.3.1

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list




[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux