Skip to content

Commit

Permalink
Append "file://" in front of uri if it exists.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vasuvi authored and mason-larobina committed Aug 25, 2010
1 parent 1a19b82 commit 09df358
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions widgets/webview.c
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,8 @@ luaH_webview_newindex(lua_State *L, luakit_token_t token)
tmp.c = (gchar*) luaL_checklstring(L, 3, &len);
if (g_strrstr(tmp.c, "://") || !g_strcmp0(tmp.c, "about:blank"))
tmp.c = g_strdup(tmp.c);
else if(file_exists(tmp.c))
tmp.c = g_strdup_printf("file://%s", tmp.c);
else
tmp.c = g_strdup_printf("http://%s", tmp.c);
webkit_web_view_load_uri(WEBKIT_WEB_VIEW(view), tmp.c);
Expand Down

0 comments on commit 09df358

Please sign in to comment.