1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-02 20:00:57 +02:00

users/24451: zgetcwd: Add a guard against returning an empty string.

This commit is contained in:
Daniel Shahaf 2019-11-19 19:20:25 +00:00
parent 030440d5b7
commit 87db974a84
2 changed files with 4 additions and 1 deletions

View file

@ -1,5 +1,8 @@
2019-11-19 Daniel Shahaf <d.s@daniel.shahaf.name>
* users/24451: Src/compat.c: zgetcwd: Add a guard against
returning an empty string.
* unposted: Test/W01history.ztst: Add smoke test for :P history
modifier.

View file

@ -519,7 +519,7 @@ zgetcwd(void)
#endif /* HAVE_GETCWD */
if (!ret)
ret = unmeta(pwd);
if (!ret)
if (!ret || *ret == '\0')
ret = dupstring(".");
return ret;
}