From 9eab66131d27438e971fb5feddd9f4c0a9e8d801 Mon Sep 17 00:00:00 2001 From: rlar Date: Tue, 30 Jul 2013 21:35:56 +0200 Subject: [PATCH] cp_variablesubst() and cp_bquote(), rewrite --- src/frontend/parser/backq.c | 3 +-- src/frontend/variable.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/frontend/parser/backq.c b/src/frontend/parser/backq.c index 3dfe75bdf..46fae83d0 100644 --- a/src/frontend/parser/backq.c +++ b/src/frontend/parser/backq.c @@ -37,9 +37,8 @@ cp_bquote(wordlist *wlist) while (t < s) wbuf[i++] = *t++; wbuf[i] = '\0'; - (void) strcpy(buf, ++s); + (void) strcpy(buf, ++t); s = buf; - t++; while (*s && (*s != cp_back)) { t++; /* Get s and t past the next backquote. */ s++; diff --git a/src/frontend/variable.c b/src/frontend/variable.c index 683f8faee..f52c79171 100644 --- a/src/frontend/variable.c +++ b/src/frontend/variable.c @@ -691,9 +691,8 @@ cp_variablesubst(wordlist *wlist) while (t < s) wbuf[i++] = *t++; wbuf[i] = '\0'; - (void) strcpy(buf, ++s); + (void) strcpy(buf, ++t); s = buf; - t++; while (*s && (isalphanum(*s) || strchr(VALIDCHARS, *s))) { /* Get s and t past the end of the var name. */ t++;