bug#69437: basename fails with suffix containing slash

Zefram via "Bug reports for GUILE, GNU's Ubiquitous Extension Language" <[email protected]>
Newsgroups gmane.lisp.guile.bugs
Message-ID <[email protected]>
$ guile-3.0.9 -c '(write (basename "foo/bar" "o/bar")) (newline)'
Backtrace:
[...]
ERROR: In procedure basename:
Value out of range: 18446744073709551614

Looks like this decides based on the whole pathname that the
five-character suffix matches, and then tries to remove that suffix
from the three-character basename.  This is not sensible behaviour.
It should probably signal an error if given any suffix argument that
contains a slash character.  If not, then it should be comparing the
suffix against the basename, not the complete pathname, with the effect
that a suffix containing a slash will never be matched and so no attempt
will be made to remove it.

-zefram
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.