cp_variablesubst() and cp_bquote(), rewrite
This commit is contained in:
parent
9eab66131d
commit
909f087237
|
|
@ -37,12 +37,11 @@ cp_bquote(wordlist *wlist)
|
|||
while (t < s)
|
||||
wbuf[i++] = *t++;
|
||||
wbuf[i] = '\0';
|
||||
(void) strcpy(buf, ++t);
|
||||
t++;
|
||||
s = buf;
|
||||
while (*s && (*s != cp_back)) {
|
||||
t++; /* Get s and t past the next backquote. */
|
||||
s++;
|
||||
}
|
||||
/* Get s and t past the next backquote. */
|
||||
while (*t && (*t != cp_back))
|
||||
*s++ = *t++;
|
||||
/* What the heck, let "echo `foo" work... */
|
||||
*s = '\0';
|
||||
t++; /* Get past the second ` */
|
||||
|
|
|
|||
|
|
@ -691,13 +691,11 @@ cp_variablesubst(wordlist *wlist)
|
|||
while (t < s)
|
||||
wbuf[i++] = *t++;
|
||||
wbuf[i] = '\0';
|
||||
(void) strcpy(buf, ++t);
|
||||
t++;
|
||||
s = buf;
|
||||
while (*s && (isalphanum(*s) || strchr(VALIDCHARS, *s))) {
|
||||
/* Get s and t past the end of the var name. */
|
||||
t++;
|
||||
s++;
|
||||
}
|
||||
/* Get s and t past the end of the var name. */
|
||||
while (*t && (isalphanum(*t) || strchr(VALIDCHARS, *t)))
|
||||
*s++ = *t++;
|
||||
*s = '\0';
|
||||
nwl = vareval(buf);
|
||||
if (i) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue