diff options
Diffstat (limited to 'src/uzbl-core.c')
-rw-r--r-- | src/uzbl-core.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/uzbl-core.c b/src/uzbl-core.c index ca936c1..6809441 100644 --- a/src/uzbl-core.c +++ b/src/uzbl-core.c @@ -1217,11 +1217,16 @@ move_statusbar() { } gboolean +valid_name(const gchar* name) { + char *invalid_chars = "\t^°!\"§$%&/()=?'`'+~*'#-:,;@<>| \\{}[]¹²³¼½"; + return strpbrk(name, invalid_chars) == NULL; +} + +gboolean set_var_value(const gchar *name, gchar *val) { uzbl_cmdprop *c = NULL; char *endp = NULL; char *buf = NULL; - char *invalid_chars = "\t^°!\"§$%&/()=?'`'+~*'#-:,;@<>| \\{}[]¹²³¼½"; if( (c = g_hash_table_lookup(uzbl.comm.proto_var, name)) ) { if(!c->writeable) return FALSE; @@ -1261,7 +1266,7 @@ set_var_value(const gchar *name, gchar *val) { if(c->func) c->func(); } else { /* check wether name violates our naming scheme */ - if(strpbrk(name, invalid_chars)) { + if(!valid_name(name)) { if (uzbl.state.verbose) printf("Invalid variable name: %s\n", name); return FALSE; |