diff --git a/lisp/eshell/esh-util.el b/lisp/eshell/esh-util.el index 129134814e3..47645231b75 100644 --- a/lisp/eshell/esh-util.el +++ b/lisp/eshell/esh-util.el @@ -458,8 +458,7 @@ Prepend remote identification of `default-directory', if any." (string-prefix-p "//" filename)) (setq index 2)) (while (< index len) - (when (and (eq (aref filename index) ?/) - (not (get-text-property index 'escaped filename))) + (when (eq (aref filename index) ?/) (push (if (= curr-start index) "/" (substring filename curr-start (1+ index))) parts) diff --git a/test/lisp/eshell/em-glob-tests.el b/test/lisp/eshell/em-glob-tests.el index 40cdfd1a676..d7d8f59eda0 100644 --- a/test/lisp/eshell/em-glob-tests.el +++ b/test/lisp/eshell/em-glob-tests.el @@ -146,6 +146,12 @@ value of `eshell-glob-splice-results'." `(,(format "%s/some/where/" remote) (("\\`.*\\.el\\'" . "\\`\\.")) nil))))) +(ert-deftest em-glob-test/convert/quoted-start-directory () + "Test converting a glob starting in a quoted directory name." + (should (equal (eshell-glob-convert + (concat (eshell-escape-arg "some where/") "*.el")) + '("./some where/" (("\\`.*\\.el\\'" . "\\`\\.")) nil)))) + ;; Glob matching