* bug#69437: basename fails with suffix containing slash
@ 2024-02-27 20:19 Zefram via Bug reports for GUILE, GNU's Ubiquitous Extension Language
2024-08-03 19:52 ` Rob Browning
0 siblings, 1 reply; 2+ messages 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] 2+ messages in thread
* bug#69437: basename fails with suffix containing slash
2024-02-27 20:19 bug#69437: basename fails with suffix containing slash Zefram via Bug reports for GUILE, GNU's Ubiquitous Extension Language
@ 2024-08-03 19:52 ` Rob Browning
0 siblings, 0 replies; 2+ messages in thread
From: Rob Browning @ 2024-08-03 19:52 UTC (permalink / raw)
To: 69437-done; +Cc: Zefram
Zefram <zefram@fysh.org> writes:
> $ guile-3.0.9 -c '(write (basename "foo/bar" "o/bar")) (newline)'
> Backtrace:
> [...]
> ERROR: In procedure basename:
> Value out of range: 18446744073709551614
Hopefully fixed in main now via:
commit c03115c39d35784e87187b467e783d21a326eaf2
basename: check suffix against basename, not full argument
* libguile/filesys: check suffix against basename, not full argument.
Thanks for the report
--
Rob Browning
rlb @defaultvalue.org and @debian.org
GPG as of 2011-07-10 E6A9 DA3C C9FD 1FF8 C676 D2C4 C0F0 39E9 ED1B 597A
GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-08-03 19:52 UTC | newest]
Thread overview: 2+ messages (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
2024-08-03 19:52 ` Rob Browning
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).