GNU bug report logs - #69437
basename fails with suffix containing slash

Previous Next

Package: guile;

Reported by: Zefram <zefram <at> fysh.org>

Date: Tue, 27 Feb 2024 20:26:03 UTC

Severity: normal

Done: Rob Browning <rlb <at> defaultvalue.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 69437 in the body.
You can then email your comments to 69437 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guile <at> gnu.org:
bug#69437; Package guile. (Tue, 27 Feb 2024 20:26:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Zefram <zefram <at> fysh.org>:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Tue, 27 Feb 2024 20:26:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Zefram <zefram <at> fysh.org>
To: bug-guile <at> gnu.org
Subject: basename fails with suffix containing slash
Date: Tue, 27 Feb 2024 20:19:44 +0000
$ 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




Reply sent to Rob Browning <rlb <at> defaultvalue.org>:
You have taken responsibility. (Sat, 03 Aug 2024 19:54:02 GMT) Full text and rfc822 format available.

Notification sent to Zefram <zefram <at> fysh.org>:
bug acknowledged by developer. (Sat, 03 Aug 2024 19:54:02 GMT) Full text and rfc822 format available.

Message #10 received at 69437-done <at> debbugs.gnu.org (full text, mbox):

From: Rob Browning <rlb <at> defaultvalue.org>
To: 69437-done <at> debbugs.gnu.org
Cc: Zefram <zefram <at> fysh.org>
Subject: Re: bug#69437: basename fails with suffix containing slash
Date: Sat, 03 Aug 2024 14:52:54 -0500
Zefram <zefram <at> 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




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 01 Sep 2024 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 83 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.