diff options
author | Robert Manea <gotmor@gmail.com> | 2009-06-18 20:36:14 +0200 |
---|---|---|
committer | Robert Manea <gotmor@gmail.com> | 2009-06-18 20:36:14 +0200 |
commit | 53357d65eaac90ea3b51bc56d17851df00cd3891 (patch) | |
tree | c3e0d67359da6111c9ef4ace6138f09ba278721e /uzbl.c | |
parent | 2f190e06ba4f408ac862bff902f169703d38da85 (diff) |
make detection of simple vars more shell like
Diffstat (limited to 'uzbl.c')
-rw-r--r-- | uzbl.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -216,6 +216,7 @@ expand(char *s, gboolean recurse) { uzbl_cmdprop *c; guint etype; char upto = ' '; + char *end_simple_var = "^°!\"§$%&/()=?'`'+~*'#-.:,;@<>| \\{}[]¹²³¼½"; char str_end[2]; char ret[4096]; char *vend; @@ -238,9 +239,8 @@ expand(char *s, gboolean recurse) { switch(etype) { case EXP_SIMPLE_VAR: - upto = ' '; - if( (vend = strchr(s, upto)) || - (vend = strchr(s, '\0')) ) { + if( (vend = strpbrk(s, end_simple_var)) || + (vend = strchr(s, '\0')) ) { strncpy(ret, s, vend-s); ret[vend-s] = '\0'; } @@ -248,7 +248,7 @@ expand(char *s, gboolean recurse) { case EXP_BRACED_VAR: s++; upto = '}'; if( (vend = strchr(s, upto)) || - (vend = strchr(s, '\0')) ) { + (vend = strchr(s, '\0')) ) { strncpy(ret, s, vend-s); ret[vend-s] = '\0'; } @@ -258,7 +258,7 @@ expand(char *s, gboolean recurse) { strcpy(str_end, ")@"); str_end[2] = '\0'; if( (vend = strstr(s, str_end)) || - (vend = strchr(s, '\0')) ) { + (vend = strchr(s, '\0')) ) { strncpy(ret, s, vend-s); ret[vend-s] = '\0'; } @@ -268,7 +268,7 @@ expand(char *s, gboolean recurse) { strcpy(str_end, ">@"); str_end[2] = '\0'; if( (vend = strstr(s, str_end)) || - (vend = strchr(s, '\0')) ) { + (vend = strchr(s, '\0')) ) { strncpy(ret, s, vend-s); ret[vend-s] = '\0'; } |