gboolean vb_load_uri(const Arg *arg)
{
- char *uri = NULL, *rp, *path = arg->s;
+ char *uri = NULL, *rp, *path = arg->s ? arg->s : "";
struct stat st;
- if (!path) {
- path = vb.config.home_page;
- }
-
g_strstrip(path);
- if (!strlen(path)) {
+ if (*path == '\0') {
path = vb.config.home_page;
}
- if (g_strrstr(path, "://")) {
+ if (g_strrstr(path, "://") || !strncmp(path, "about:", 6)) {
uri = g_strdup(path);
} else if (stat(path, &st) == 0) {
/* check if the path is a file path */
if (type == SETTING_GET) {
print_value(s, vb.config.home_page);
} else {
- OVERWRITE_STRING(vb.config.home_page, s->arg.s);
+ OVERWRITE_STRING(
+ vb.config.home_page,
+ *(s->arg.s) == '\0' ? "about:blank" : s->arg.s
+ );
}
return true;