summaryrefslogtreecommitdiff
path: root/common/expr.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/expr.c')
-rw-r--r--common/expr.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/common/expr.c b/common/expr.c
index fc694cc..7fa4f84 100644
--- a/common/expr.c
+++ b/common/expr.c
@@ -93,6 +93,8 @@ MUST_USE static const char *parse_dollar_expression(
if (parse_name(str,ptr,varname,sizeof(varname))==NULL)
return NULL;
varvalue=expander(varname,expander_arg);
+ if (varvalue==NULL)
+ varvalue="";
if (str[*ptr]=='}')
{
/* simple substitute */
@@ -148,6 +150,8 @@ MUST_USE static const char *parse_dollar_expression(
if (parse_name(str,ptr,varname,sizeof(varname))==NULL)
return NULL;
varvalue=expander(varname,expander_arg);
+ if (varvalue==NULL)
+ varvalue="";
if (strlen(varvalue)>=buflen)
return NULL;
strcpy(buffer,varvalue);