[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/np/backports-26.2 47ab98e 8/9: esh-opt.el: Fix imp
From: |
Noam Postavsky |
Subject: |
[Emacs-diffs] scratch/np/backports-26.2 47ab98e 8/9: esh-opt.el: Fix improper parsing of first argument (Bug#28323) |
Date: |
Sun, 3 Jun 2018 08:02:33 -0400 (EDT) |
branch: scratch/np/backports-26.2
commit 47ab98ebea7e33b4dc95157300dadf124a087292
Author: Jay Kamat <address@hidden>
Commit: Noam Postavsky <address@hidden>
esh-opt.el: Fix improper parsing of first argument (Bug#28323)
Examples of broken behavior:
sudo -u root whoami
Outputs: -u
ls -I '*.txt' /dev/null
Errors with: *.txt: No such file or directory
* lisp/eshell/esh-opt.el (eshell--process-args): Refactor usage of
args to eshell--args, as we rely on modifications from
eshell--process-option and vice versa. These modifications were not
being propogated in the (if (= ai 0)) case, since popping the first
element of a list doesn't destructively modify the underlying list
object.
(cherry picked from commit 92a8230e49a65be48442ee95cf50c90514e48f99)
---
lisp/eshell/esh-opt.el | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/lisp/eshell/esh-opt.el b/lisp/eshell/esh-opt.el
index 3af8fd7..7d0b362 100644
--- a/lisp/eshell/esh-opt.el
+++ b/lisp/eshell/esh-opt.el
@@ -244,26 +244,27 @@ switch is unrecognized."
options)))
(ai 0) arg
(eshell--args args))
- (while (< ai (length args))
- (setq arg (nth ai args))
+ (while (< ai (length eshell--args))
+ (setq arg (nth ai eshell--args))
(if (not (and (stringp arg)
(string-match "^-\\(-\\)?\\(.*\\)" arg)))
(setq ai (1+ ai))
(let* ((dash (match-string 1 arg))
(switch (match-string 2 arg)))
(if (= ai 0)
- (setq args (cdr args))
- (setcdr (nthcdr (1- ai) args) (nthcdr (1+ ai) args)))
+ (setq eshell--args (cdr eshell--args))
+ (setcdr (nthcdr (1- ai) eshell--args)
+ (nthcdr (1+ ai) eshell--args)))
(if dash
(if (> (length switch) 0)
(eshell--process-option name switch 1 ai options opt-vals)
- (setq ai (length args)))
+ (setq ai (length eshell--args)))
(let ((len (length switch))
(index 0))
(while (< index len)
(eshell--process-option name (aref switch index)
0 ai options opt-vals)
(setq index (1+ index))))))))
- (nconc (mapcar #'cdr opt-vals) args)))
+ (nconc (mapcar #'cdr opt-vals) eshell--args)))
;;; esh-opt.el ends here
- [Emacs-diffs] branch scratch/np/backports-26.2 created (now 2305ee7), Noam Postavsky, 2018/06/03
- [Emacs-diffs] scratch/np/backports-26.2 4491b27 2/9: Fix CHECK_ALLOCATED_AND_LIVE abort during GC, Noam Postavsky, 2018/06/03
- [Emacs-diffs] scratch/np/backports-26.2 09d0493 4/9: Centralize Bug#30931 fix, Noam Postavsky, 2018/06/03
- [Emacs-diffs] scratch/np/backports-26.2 e54624a 1/9: Don't wait for visible frames to become visible, Noam Postavsky, 2018/06/03
- [Emacs-diffs] scratch/np/backports-26.2 0058ef3 6/9: Fix cl-print for circular sublists (Bug#31146), Noam Postavsky, 2018/06/03
- [Emacs-diffs] scratch/np/backports-26.2 9c78312 3/9: Fix another case of freed markers in the undo-list (Bug#30931), Noam Postavsky, 2018/06/03
- [Emacs-diffs] scratch/np/backports-26.2 c1a5546 7/9: * lisp/epa.el (epa-decrypt-file): Apply epa-pinentry-mode (Bug#30363)., Noam Postavsky, 2018/06/03
- [Emacs-diffs] scratch/np/backports-26.2 47ab98e 8/9: esh-opt.el: Fix improper parsing of first argument (Bug#28323),
Noam Postavsky <=
- [Emacs-diffs] scratch/np/backports-26.2 2305ee7 9/9: Fix bug#30846, along with misc cleanups found along the way, Noam Postavsky, 2018/06/03
- [Emacs-diffs] scratch/np/backports-26.2 67f164a 5/9: Revert "Make mail-extract-address-components return the user name more", Noam Postavsky, 2018/06/03