branch: externals-release/plz
commit 528ce2fba20e14c5ec63c14e53141db1cd4b7e93
Author: Joseph Turner <jos...@breatheoutbreathe.in>
Commit: Adam Porter <a...@alphapapa.net>

    Fix: (plz) Expand as-filename
---
 plz.el | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/plz.el b/plz.el
index 3eb64ed78a..7425f155a3 100644
--- a/plz.el
+++ b/plz.el
@@ -454,7 +454,9 @@ into the process buffer.
                                                 (`(file ,(and (pred stringp) 
as-filename))
                                                  (when (file-exists-p 
as-filename)
                                                    (error "File exists, will 
not overwrite: %S" as-filename))
-                                                 (setf filename as-filename)
+                                                 ;; Use `expand-file-name' 
because curl doesn't
+                                                 ;; expand, e.g. "~" into 
"/home/...".
+                                                 (setf filename 
(expand-file-name as-filename))
                                                  (list (cons "--output" 
filename))))))
                                      ((or 'put 'post)
                                       (append (list (cons "--dump-header" "-")
@@ -466,7 +468,9 @@ into the process buffer.
                                                 (`(file ,(and (pred stringp) 
as-filename))
                                                  (when (file-exists-p 
as-filename)
                                                    (error "File exists, will 
not overwrite: %S" as-filename))
-                                                 (setf filename as-filename)
+                                                 ;; Use `expand-file-name' 
because curl doesn't
+                                                 ;; expand, e.g. "~" into 
"/home/...".
+                                                 (setf filename 
(expand-file-name as-filename))
                                                  (list (cons "--output" 
filename))))
                                               (list
                                                ;; It appears that this must be 
the last argument
@@ -487,7 +491,9 @@ into the process buffer.
                                                 (`(file ,(and (pred stringp) 
as-filename))
                                                  (when (file-exists-p 
as-filename)
                                                    (error "File exists, will 
not overwrite: %S" as-filename))
-                                                 (setf filename as-filename)
+                                                 ;; Use `expand-file-name' 
because curl doesn't
+                                                 ;; expand, e.g. "~" into 
"/home/...".
+                                                 (setf filename 
(expand-file-name as-filename))
                                                  (list (cons "--output" 
filename))))))
                                      ('head
                                       (list (cons "--head" "")

Reply via email to