Currently if HOME is set to empty tilde expansion will fail, i.e.,
it will remain as a literal tilde.  This patch changes it to
return the empty string as required by POSIX.

Signed-off-by: Herbert Xu <herb...@gondor.apana.org.au>

diff --git a/src/expand.c b/src/expand.c
index 45e9b79..eb50e15 100644
--- a/src/expand.c
+++ b/src/expand.c
@@ -385,7 +385,7 @@ done:
        } else {
                home = getpwhome(name);
        }
-       if (!home || !*home)
+       if (!home)
                goto lose;
        *p = c;
        strtodest(home, SQSYNTAX, quotes);
-- 
Email: Herbert Xu <herb...@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to