diff options
author | Christophe Fergeau <cfergeau@redhat.com> | 2013-10-29 10:14:29 +0100 |
---|---|---|
committer | Christophe Fergeau <cfergeau@redhat.com> | 2013-10-29 15:12:17 +0100 |
commit | 69ffdb50b9b83c031af4968ff40da084ecfda934 (patch) | |
tree | 5a5f4307d2988b202a80246fe49ac1d854af1a51 /src/remote-viewer.c | |
parent | 39feb118b59ef451816627d0e624827be2a1b79b (diff) | |
download | virt-viewer-69ffdb50b9b83c031af4968ff40da084ecfda934.tar.gz virt-viewer-69ffdb50b9b83c031af4968ff40da084ecfda934.tar.xz virt-viewer-69ffdb50b9b83c031af4968ff40da084ecfda934.zip |
Clean-up spaces before/after URI in connection dialog
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
Diffstat (limited to 'src/remote-viewer.c')
-rw-r--r-- | src/remote-viewer.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/remote-viewer.c b/src/remote-viewer.c index 3f2801f..cf1ff1e 100644 --- a/src/remote-viewer.c +++ b/src/remote-viewer.c @@ -918,6 +918,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; |