Skip to content

Commit 819904a

Browse files
authored
Merge pull request #908 from rswgnu/rsw
hpath:validate - Fix 'suffix-start' non-numeric comparison
2 parents e96444b + 2b2841f commit 819904a

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

ChangeLog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
2026-03-17 Bob Weiner <rsw@gnu.org>
22

3+
* hpath.el (hpath:validate): 'suffix-start' can be nil, so replace
4+
(zerop suffix-start) with (equal suffix-start 0).
5+
36
* hibtypes.el (pathname): Add a clause to handle "#section" links by
47
themselves as some change had broken this capability.
58

hpath.el

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
;; Author: Bob Weiner
44
;;
55
;; Orig-Date: 1-Nov-91 at 00:44:23
6-
;; Last-Mod: 17-Mar-26 at 19:07:23 by Bob Weiner
6+
;; Last-Mod: 17-Mar-26 at 22:51:48 by Bob Weiner
77
;;
88
;; SPDX-License-Identifier: GPL-3.0-or-later
99
;;
@@ -2344,7 +2344,8 @@ to it."
23442344
(let* ((suffix-start (cl-position ?# path))
23452345
(path-only (substring path 0 suffix-start))
23462346
(suffix (when suffix-start (substring path suffix-start))))
2347-
(cond ((zerop suffix-start) ;; all suffix, nothing to validate
2347+
;; `suffix-start' may be nil, so don't use `zerop' or `=' in next line
2348+
(cond ((equal suffix-start 0) ;; all suffix, nothing to validate
23482349
path)
23492350
((or (string-match "[()]" path-only) (hpath:remote-p path-only))
23502351
;; info or remote path, so don't validate

0 commit comments

Comments
 (0)