mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-04 20:40:57 +02:00
users/24451: zgetcwd: Add a guard against returning an empty string.
This commit is contained in:
parent
030440d5b7
commit
87db974a84
2 changed files with 4 additions and 1 deletions
|
@ -1,5 +1,8 @@
|
||||||
2019-11-19 Daniel Shahaf <d.s@daniel.shahaf.name>
|
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
|
* unposted: Test/W01history.ztst: Add smoke test for :P history
|
||||||
modifier.
|
modifier.
|
||||||
|
|
||||||
|
|
|
@ -519,7 +519,7 @@ zgetcwd(void)
|
||||||
#endif /* HAVE_GETCWD */
|
#endif /* HAVE_GETCWD */
|
||||||
if (!ret)
|
if (!ret)
|
||||||
ret = unmeta(pwd);
|
ret = unmeta(pwd);
|
||||||
if (!ret)
|
if (!ret || *ret == '\0')
|
||||||
ret = dupstring(".");
|
ret = dupstring(".");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue