about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--xxxterm.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/xxxterm.c b/xxxterm.c
index 3be93d9..e78b14f 100644
--- a/xxxterm.c
+++ b/xxxterm.c
@@ -41,6 +41,7 @@
 #include <errno.h>
 #include <signal.h>
 #include <libgen.h>
+#include <ctype.h>
 
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -1156,6 +1157,13 @@ load_uri(WebKitWebView *wv, gchar *uri)
 	if (uri == NULL || !strlen(uri))
 		return;
 
+	/* Strip leading spaces. */
+	while(*uri && isspace(*uri))
+		uri++;
+
+	if (!strlen(uri))
+		return;
+
 	if (valid_url_type(uri)) {
 		newuri = guess_url_type(uri);
 		uri = newuri;