aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--CHECKLIST5
-rw-r--r--uzbl.c19
2 files changed, 19 insertions, 5 deletions
diff --git a/CHECKLIST b/CHECKLIST
index c2a722a..454ccaa 100644
--- a/CHECKLIST
+++ b/CHECKLIST
@@ -14,6 +14,9 @@ Also testers and interested people can use this list to see what uzbl is about,
* invocations of external commands: you'll see it on stdout everytime uzbl calls an external script/program. the invocations should work and none of the arguments passed should be null/garbage/.. .
all should be valid strings and contain things like the pid, fifo file, config file,.. (see README for details).
* XDG_CONFIG_HOME and XDG_CONFIG_DIRS (+ default values) fully supported and working (looks for a config file called 'uzbl').
+* --uri can be specified without http:// -- if missing will be prepended.
TODO: add stuff about internal/external keybinds, mod key, insert mode, status bar,
-behavior settings,.... \ No newline at end of file
+behavior settings,....
+
+TODO: add 'http://' to url if there is no substr '://'
diff --git a/uzbl.c b/uzbl.c
index 3528bf4..da73bfe 100644
--- a/uzbl.c
+++ b/uzbl.c
@@ -214,9 +214,20 @@ static Command commands[] =
/* -- CORE FUNCTIONS -- */
+static gchar*
+uricheck (gchar* uri) {
+ if (g_strrstr (uri,"://") == NULL) {
+ GString* newuri = g_string_new (uri);
+ free(uri);
+ g_string_prepend (newuri, "http://");
+ uri = g_string_free (newuri, FALSE);
+ }
+ return (uri);
+}
+
+
static bool
-file_exists (const char * filename)
-{
+file_exists (const char * filename) {
FILE *file = fopen (filename, "r");
if (file) {
fclose (file);
@@ -260,7 +271,7 @@ parse_command(const char *cmd) {
if (c->func_2_params != NULL) {
if (command_param != NULL) {
printf ("command executing: \"%s %s\"\n", command_name, command_param);
- c->func_2_params (web_view, command_param);
+ c->func_2_params (web_view, uricheck(command_param));
} else {
if (c->func_1_param != NULL) {
printf ("command executing: \"%s\"\n", command_name);
@@ -605,7 +616,7 @@ main (int argc, char* argv[]) {
main_window = create_window ();
gtk_container_add (GTK_CONTAINER (main_window), vbox);
- webkit_web_view_load_uri (web_view, uri);
+ webkit_web_view_load_uri (web_view, uricheck(uri));
gtk_widget_grab_focus (GTK_WIDGET (web_view));
gtk_widget_show_all (main_window);