mirror of
https://https.git.savannah.gnu.org/git/gnulib.git
synced 2026-04-28 06:33:36 +00:00
getcwd: Return "/bin" instead of "//bin" on Adélie Linux.
Reported by Zach van Rijn <me@zv.io> in <https://lists.gnu.org/archive/html/bug-gnulib/2023-04/msg00072.html> and <https://git.adelielinux.org/adelie/packages/-/issues/987>. * lib/getcwd.c (__getcwd_generic): Remove a trailing slash from the result of readlink().
This commit is contained in:
@@ -1,3 +1,12 @@
|
||||
2024-12-31 Bruno Haible <bruno@clisp.org>
|
||||
|
||||
getcwd: Return "/bin" instead of "//bin" on Adélie Linux.
|
||||
Reported by Zach van Rijn <me@zv.io> in
|
||||
<https://lists.gnu.org/archive/html/bug-gnulib/2023-04/msg00072.html>
|
||||
and <https://git.adelielinux.org/adelie/packages/-/issues/987>.
|
||||
* lib/getcwd.c (__getcwd_generic): Remove a trailing slash from the
|
||||
result of readlink().
|
||||
|
||||
2024-12-28 Bruno Haible <bruno@clisp.org>
|
||||
|
||||
assert-h, verify: Make static_assert work in C++ mode on FreeBSD 11.
|
||||
|
||||
@@ -478,6 +478,12 @@ __getcwd_generic (char *buf, size_t size)
|
||||
}
|
||||
else
|
||||
{
|
||||
/* *dirp is already a '/' (see above). Therefore if the directory
|
||||
ends in a slash, we can remove that slash. This happens in
|
||||
particular if the directory is "/". */
|
||||
if (linklen > 0 && linkbuf[linklen - 1] == '/')
|
||||
linklen--;
|
||||
|
||||
dirroom = dirp - dir;
|
||||
if (dirroom < linklen)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user