summaryrefslogtreecommitdiff
path: root/expand.c
diff options
context:
space:
mode:
Diffstat (limited to 'expand.c')
-rw-r--r--expand.c14
1 files changed, 6 insertions, 8 deletions
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);
}