summary refs log tree commit diff
path: root/posix/wordexp.c
diff options
context:
space:
mode:
Diffstat (limited to 'posix/wordexp.c')
-rw-r--r--posix/wordexp.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/posix/wordexp.c b/posix/wordexp.c
index dde9183db5..302cf0884f 100644
--- a/posix/wordexp.c
+++ b/posix/wordexp.c
@@ -2236,6 +2236,14 @@ wordexp (const char *words, wordexp_t *pwordexp, int flags)
 	if (error)
 	  goto do_error;
 
+	if (!word_length)
+	  {
+	    error = w_addword (pwordexp, NULL);
+
+	    if (error)
+	      return error;
+	  }
+
 	break;
 
       case '\'':
@@ -2246,6 +2254,14 @@ wordexp (const char *words, wordexp_t *pwordexp, int flags)
 	if (error)
 	  goto do_error;
 
+	if (!word_length)
+	  {
+	    error = w_addword (pwordexp, NULL);
+
+	    if (error)
+	      return error;
+	  }
+
 	break;
 
       case '~':