From 53357d65eaac90ea3b51bc56d17851df00cd3891 Mon Sep 17 00:00:00 2001 From: Robert Manea Date: Thu, 18 Jun 2009 20:36:14 +0200 Subject: [PATCH] make detection of simple vars more shell like --- uzbl.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/uzbl.c b/uzbl.c index 1f2a9e8..bbb1d00 100644 --- a/uzbl.c +++ b/uzbl.c @@ -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'; } -- 1.7.9.5