diff options
author | Paweł Zuzelski <pawelz@pld-linux.org> | 2010-01-12 14:07:36 +0100 |
---|---|---|
committer | Paweł Zuzelski <pawelz@pld-linux.org> | 2010-01-12 14:07:36 +0100 |
commit | 54ed45392b4602fd22c0869afee5a57ab92ecfc2 (patch) | |
tree | 521d3749ed6640023b90b98de78136ab8007d244 | |
parent | 8a6ceac5f1853afe72064dda42cc8bb6a64b4b41 (diff) |
Strip leading whitespaces from uri.
-rw-r--r-- | src/uzbl-core.c | 7 | ||||
-rw-r--r-- | src/uzbl-core.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/uzbl-core.c b/src/uzbl-core.c index 462feb5..c9b3825 100644 --- a/src/uzbl-core.c +++ b/src/uzbl-core.c @@ -2534,6 +2534,13 @@ initialize(int argc, char *argv[]) { void load_uri_imp(gchar *uri) { GString* newuri; + + /* Strip leading whitespaces */ + while (*uri) { + if (!isspace(*uri)) break; + uri++; + } + if (g_strstr_len (uri, 11, "javascript:") != NULL) { eval_js(uzbl.gui.web_view, uri, NULL); return; diff --git a/src/uzbl-core.h b/src/uzbl-core.h index 998ea1d..875feae 100644 --- a/src/uzbl-core.h +++ b/src/uzbl-core.h @@ -28,6 +28,7 @@ #include <stdio.h> #include <string.h> +#include <ctype.h> #include <unistd.h> #include <stdlib.h> #include <errno.h> |