GNU bug report logs - #76982
30.1; url-generic-parse-url cannot parse Windows file paths

Previous Next

Package: emacs;

Reported by: Morgan Willcock <morgan <at> ice9.digital>

Date: Wed, 12 Mar 2025 17:54:02 UTC

Severity: normal

Tags: patch

Found in version 30.1

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Sebastián Monía <sebastian <at> sebasmonia.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 76982 <at> debbugs.gnu.org, morgan <at> ice9.digital
Subject: bug#76982: 30.1; url-generic-parse-url cannot parse Windows file paths
Date: Mon, 07 Apr 2025 11:48:45 -0400
Eli Zaretskii <eliz <at> gnu.org> writes:
> It can have other components in file:// URIs?  If so, can you show an
> example?

The URIs can have an "authority" segment, an example from
https://www.rfc-editor.org/rfc/rfc8089.html#appendix-B

"file://host.example.com/path/to/file"

And also I just noticed that "localhost" is valid for authority, so I
should add a test like this:

(should (equal (url-filename (url-generic-parse-url "file://localhost/c:/path/to/file")) "c:/path/to/file"))

> The problem with your proposal is that the value of 'file' is
> incorrect between where it is first set and where you correct it.  Any
> code added later that uses 'file' in-between might cause bugs if the
> person who adds such code is not aware of this subtlety.  By contrast,
> under my suggestion 'file' has the correct value from the get-go.

You are right :) I hadn't considered this. Will revisit the code and see
how I can handle things earlier.



-- 
Sebastián Monía
https://site.sebasmonia.com/




This bug report was last modified 37 days ago.

Previous Next


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