From b7c728046e3f32cd93b04fa4a19a69cf6135e6e4 Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Thu, 30 Jan 2003 06:21:36 +0000 Subject: Enhancement (bug #2407) Make error messages more clear. --- expand.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'expand.c') diff --git a/expand.c b/expand.c index ac4ccda..922b1e3 100644 --- a/expand.c +++ b/expand.c @@ -411,7 +411,7 @@ variable_expand (char *line) variable-expansion that is in progress. */ char * -expand_argument (char *str, char *end) +expand_argument (const char *str, const char *end) { char *tmp; @@ -419,13 +419,11 @@ expand_argument (char *str, char *end) return xstrdup(""); if (!end || *end == '\0') - tmp = str; - else - { - tmp = (char *) alloca (end - str + 1); - bcopy (str, tmp, end - str); - tmp[end - str] = '\0'; - } + return allocated_variable_expand ((char *)str); + + tmp = (char *) alloca (end - str + 1); + bcopy (str, tmp, end - str); + tmp[end - str] = '\0'; return allocated_variable_expand (tmp); } -- cgit v1.2.3