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: Morgan Willcock <morgan <at> ice9.digital>
Cc: 76982 <at> debbugs.gnu.org
Subject: bug#76982: 30.1; url-generic-parse-url cannot parse Windows file paths
Date: Wed, 12 Mar 2025 15:23:08 -0400
[Message part 1 (text/plain, inline)]
Morgan Willcock <morgan <at> ice9.digital> writes:

>   (url-filename (url-generic-parse-url "file:///c:/windows"))
>   => "/c:/windows"
>
>   (url-filename (url-generic-parse-url "c:/windows"))
>   => "/windows"
>
> This is relevant in functions such as
> mml-expand-html-into-multipart-related, where there is a check that the
> file exists:
>
>   (when (and (null (url-type parsed))
>              (not (zerop (length (url-filename parsed))))
>              (file-exists-p (url-filename parsed)))
>     ...)
>
> An example of a real world problem is being unable to reliably send HTML
> mail when using Windows:
>
> https://github.com/jeremy-compostella/org-msg/issues/122

Attached a potential patch.

[0001-url-parse.el-Parsing-exceptions-for-Windows-paths-bu.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]

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

This bug report was last modified 36 days ago.

Previous Next


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