(wordexp): Explicit null words should be kept.
authordrepper <drepper>
Fri, 5 Nov 1999 22:31:11 +0000 (22:31 +0000)
committerdrepper <drepper>
Fri, 5 Nov 1999 22:31:11 +0000 (22:31 +0000)
posix/wordexp.c

index dde9183..302cf08 100644 (file)
@@ -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 '~':