"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Christian Weisgerber <naddy@mips.inka.de>
Subject:
Got relies on non-POSIX basename(3), dirname(3)
To:
gameoftrees@openbsd.org
Date:
Fri, 18 Sep 2020 16:42:52 +0200

Download raw body.

Thread
As I mentioned on tech@, OpenBSD declares

char    *basename(const char *);
char    *dirname(const char *);

in contradiction to POSIX, which has plain char* arguments and
explicitly says that these functions may modify the string.  In
fact, on FreeBSD they do.

Unfortunately, Got relies on the string not being modified.  I don't
know in how many places this breaks, nothing shows up in the
regression tests, but I stumbled over this case:

freebsd$ got co got.git
got: realpath: /home/naddy/got: No such file or directory

-- 
Christian "naddy" Weisgerber                          naddy@mips.inka.de