From: "Todd C. Miller" Subject: Re: support for non-const basename(3) To: Stefan Sperling Cc: gameoftrees@openbsd.org Date: Mon, 19 Oct 2020 16:16:10 -0600 On Mon, 19 Oct 2020 23:09:22 +0200, Stefan Sperling wrote: > It looks like naddy is being serious and is going to switch OpenBSD > to non-const POSIX basename(3) any time now. > > This patch should keep Got working when this happens. > > To keep the conversion simple I chose to use the got_path_basename() > wrapper everywhere, except in the resolve_symlink() function where > strlcpy into a temporary buffer seems simpler and avoids the additional > malloc/free dance. Looks good, though as naddy says, dirname(3) has a similar portability issue. - todd