file-namestring result shouldn't contain directory and device

Bug #884603 reported by Anton Kovalenko
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
Medium
Unassigned

Bug Description

Evaluate (file-namestring #P"/foo/bar/baz.txt").
Expected: "baz.txt"
Got: "/foo/bar/baz.txt"

Per CLHS entry on FILE-NAMESTRING, "file-namestring returns just the name, type, and version components of pathname.". SBCL is definitely non-conforming here.

Revision history for this message
Anton Kovalenko (anton-sw4me) wrote :

Sorry, that's invalid (my local windows-lfn-related change was the culprit)

Changed in sbcl:
status: New → Invalid
Revision history for this message
Anton Kovalenko (anton-sw4me) wrote :

Sorry again, that's _not_ invalid, but it's really a bug in sb-simple-streams (file-namestring is redefined there).

Changed in sbcl:
status: Invalid → New
Revision history for this message
Anton Kovalenko (anton-sw4me) wrote :

Patch for sb-simple-streams

Changed in sbcl:
importance: Undecided → Medium
status: New → Triaged
tags: added: ansi review
removed: conformance
Revision history for this message
Orivej Desh (orivej) wrote :

Analogous bug went into 1.1.4, but it no longer appears in master.

Revision history for this message
Orivej Desh (orivej) wrote :

Sorry, looked insufficiently well. The erroneous behaviour is introduced by loading sb-simple-streams.

Revision history for this message
Christophe Rhodes (csr21-cantab) wrote : Re: [Bug 884603] [NEW] file-namestring result shouldn't contain directory and device

 status fixcommitted
 tag -review
 done

Anton Kovalenko <email address hidden> writes:

> Public bug reported:
>
> Evaluate (file-namestring #P"/foo/bar/baz.txt").
> Expected: "baz.txt"
> Got: "/foo/bar/baz.txt"
>
> Per CLHS entry on FILE-NAMESTRING, "file-namestring returns just the
> name, type, and version components of pathname.". SBCL is definitely
> non-conforming here.

I've fixed this in a different way; I think FILE-NAMESTRING in
SB-SIMPLE-STREAMS was intended to be a utility function, not a
reimplementation of the CL function, and because of the :IMPLEMENTS
clause in the package this didn't trigger any warnings. Thanks for the
report.

Christophe

commit 2fb9cd4a2286b82e065d6c673d91e46bd7f2194d
Author: Christophe Rhodes <email address hidden>
Date: Mon Sep 9 15:09:42 2013 +0100

    rename SB-SIMPLE-STREAMS utility function

    At least, I think it was simply intended to be a utility function,
    but the FILE-NAMESTRING name is unfortunate, as that's a CL
    function, and (for other reasons) SB-SIMPLE-STREAMS claims to
    implement CL in the package lock sense, so this was not noticed at
    the time.

    This fixes lp#884603; I am unconvinced that the namestring logic is
    actually correct (keeping the distinction between NAMESTRING and
    NATIVE-NAMESTRING clear) but I'll wait for an actual user to
    complain about that before thinking too hard.

Changed in sbcl:
status: Triaged → Fix Committed
Changed in sbcl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.