emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/hyperbole 1826307 27/50: Resolve bug#43644 where final


From: Stefan Monnier
Subject: [elpa] externals/hyperbole 1826307 27/50: Resolve bug#43644 where final double quote was trimmed from strings.
Date: Wed, 17 Mar 2021 18:44:18 -0400 (EDT)

branch: externals/hyperbole
commit 18263078babd16220ed7a5441cb3740a36290c47
Author: Bob Weiner <rsw@gnu.org>
Commit: Bob Weiner <rsw@gnu.org>

    Resolve bug#43644 where final double quote was trimmed from strings.
---
 Changes  | 3 +++
 hpath.el | 7 ++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/Changes b/Changes
index 5aa21dc..312f75f 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,8 @@
 2020-11-22  Bob Weiner  <rsw@gnu.org>
 
+* hpath.el (hpath:trim): Fix to not trim trailing quoted double quote,
+    resolving bug#43644.
+
 * hibtypes.el (mail-address): If mail-address-mode-list is set to nil,
     activate this ibtype in any major mode.
 
diff --git a/hpath.el b/hpath.el
index 348b3f7..781f34a 100644
--- a/hpath.el
+++ b/hpath.el
@@ -1439,7 +1439,12 @@ Returns LINKNAME unchanged if it is not a symbolic link 
but is a pathname."
 
 (defun hpath:trim (path)
   "Return PATH with any [\" \t\n\r] characters trimmed from its start and end."
-  (string-trim path "[\" \t\n\r]+" "[\" \t\n\r]+"))
+  ;; Trim only matching starting and ending quoted double quotes (must
+  ;; be a single line string).
+  (setq path (string-trim path))
+  (when (string-match "\\`\".*\"\\'" path)
+    (setq path (string-trim path "\"" "\"")))
+  path)
 
 (defun hpath:normalize (filename)
   "Normalize and return PATH if PATH is a valid, readable path, else signal 
error."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]