# HG changeset patch # User John Wiegley # Date 1003284020 0 # Node ID 3a906538d25400d8529fb853bcab0604d9790402 # Parent 5e4848f89017f3528f6fe338208f1be2e81c5a02 (eshell/cat): Do a quick test if something is a regular file, before checking if it is a directory or symlink. This avoids a call to eshell-file-attributes, which can be expensive in some situations. diff -r 5e4848f89017 -r 3a906538d254 lisp/eshell/em-unix.el --- a/lisp/eshell/em-unix.el Wed Oct 17 02:00:00 2001 +0000 +++ b/lisp/eshell/em-unix.el Wed Oct 17 02:00:20 2001 +0000 @@ -572,9 +572,12 @@ (if (or eshell-in-pipeline-p (catch 'special (eshell-for arg args - (unless (let ((attrs (eshell-file-attributes arg))) - (and attrs (memq (aref (nth 8 attrs) 0) - '(?d ?l ?-)))) + (unless (or (and (stringp arg) + (> (length arg) 0) + (eq (aref arg 0) ?-)) + (let ((attrs (eshell-file-attributes arg))) + (and attrs (memq (aref (nth 8 attrs) 0) + '(?d ?l ?-))))) (throw 'special t))))) (let ((ext-cat (eshell-search-path "cat"))) (if ext-cat