unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#69437: basename fails with suffix containing slash
@ 2024-02-27 20:19 Zefram via Bug reports for GUILE, GNU's Ubiquitous Extension Language
  0 siblings, 0 replies; only message in thread
From: Zefram via Bug reports for GUILE, GNU's Ubiquitous Extension Language @ 2024-02-27 20:19 UTC (permalink / raw)
  To: 69437

$ 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





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-02-27 20:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-27 20:19 bug#69437: basename fails with suffix containing slash Zefram via Bug reports for GUILE, GNU's Ubiquitous Extension Language

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).