GNU bug report logs -
#6339
url-filename => "/c:/some/file.txt"
Previous Next
Full log
Message #146 received at 6339 <at> debbugs.gnu.org (full text, mbox):
Ressurrecting this discussion...
I just looked at the relevant code and at RFC 3986, and I think the
problem is that the url object returned by url-generic-parse-url has
badly named slots. That function ought to be following the RFC, instead
of imposing its own interpretation of things. So the FILENAME slot,
which is returned by url-filename, should really be two slots, PATH and
QUERY, whose meanings are unambiguously defined in the URI spec. And
there should be no expectation that the PATH part corresponds to a
filename.
In particular, RFC 3986 explicitly states that
If a URI contains an authority component, then the path component must
either be empty or begin with a slash ("/") character.
That is to say, the / is part of the path.
Unfortunately, it's inconvenient to change the contents of the struct
now, since that means changing the arglist of the url-parse-make-urlobj
constructor; that constructor is already called from Tramp, and maybe
other packages. So I think we should just explicitly state that the
FILENAME slot is really PATH and QUERY together, and wash our hands of
the matter.
This also means that it should be up to callers to convert the FILENAME
slot (i.e. PATH and QUERY) into proper filenames. The translation from
URIs to filenames is scheme-independent anyway, so it shouldn't be
handled at the level of url-generic-parse-url.
This bug report was last modified 13 years and 17 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.