GNU bug report logs - #39235
26.3; SHR: base handling errors on "."

Previous Next

Package: emacs;

Reported by: Kevin Brubeck Unhammer <unhammer <at> fsfe.org>

Date: Wed, 22 Jan 2020 13:34:01 UTC

Severity: normal

Tags: fixed

Found in version 26.3

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Kevin Brubeck Unhammer <unhammer <at> fsfe.org>
Cc: 39235 <at> debbugs.gnu.org
Subject: Re: bug#39235: 26.3; SHR: base handling errors on "."
Date: Thu, 20 Feb 2020 15:15:25 +0100
Kevin Brubeck Unhammer <unhammer <at> fsfe.org> writes:

>     (require 'shr)
>     (let ((shr-base (shr-parse-base ".")))
>        (shr-expand-url "www.example.com"))
>
> errors with
>
> Debugger entered--Lisp error: (wrong-type-argument char-or-string-p nil)
>   url-scheme-get-property(nil expand-file-name)
>   url-expand-file-name("www.example.com" "./")
>   shr-expand-url("www.example.com")

The bug here doesn't seem to be with "." per se, but when both the base
and the URL to be expanded have no protocol.

(let ((shr-base (shr-parse-base "/tmp")))
   (shr-expand-url "foo"))
=> error

(let ((shr-base (shr-parse-base "foo:/tmp")))
   (shr-expand-url "foo"))
=> "foo:foo"

(let ((shr-base (shr-parse-base "/tmp")))
   (shr-expand-url "foo:foo"))
=> "foo:foo"

I've now fixed this in the url.el library in Emacs 28.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 5 years and 93 days ago.

Previous Next


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