changeset 65167:2980740e3f1c

(eshell-rewrite-named-command): Changed the code around a bit so that an extraneous nil argument is not added to a command when no args are given.
author John Wiegley <johnw@newartisans.com>
date Fri, 26 Aug 2005 22:51:03 +0000
parents b6ae9d87069a
children b93526432c17
files lisp/eshell/esh-cmd.el
diffstat 1 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/eshell/esh-cmd.el	Fri Aug 26 22:39:49 2005 +0000
+++ b/lisp/eshell/esh-cmd.el	Fri Aug 26 22:51:03 2005 +0000
@@ -453,12 +453,14 @@
 
 (defun eshell-rewrite-named-command (terms)
   "If no other rewriting rule transforms TERMS, assume a named command."
-  (list (if eshell-in-pipeline-p
-	    'eshell-named-command*
-	  'eshell-named-command)
-	(car terms)
-	(and (cdr terms)
-	     (append (list 'list) (cdr terms)))))
+  (let ((sym (if eshell-in-pipeline-p
+		 'eshell-named-command*
+	       'eshell-named-command))
+	(cmd (car terms))
+	(args (cdr terms)))
+    (if args
+	(list sym cmd (append (list 'list) (cdr terms)))
+      (list sym cmd))))
 
 (eshell-deftest cmd named-command
   "Execute named command"