From 61027dc82de82b4e8d583de147a98617d4f2acf1 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 13 Nov 1999 00:44:55 +0000 Subject: [PATCH] (wordexp): Explicit null words should be kept. --- posix/wordexp.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 '~':