]> git.eshelyaron.com Git - emacs.git/commitdiff
Handle comments in eshell-read-hosts-file (tiny change)
authorMike Lamb <mrlamb@gmail.com>
Mon, 23 Jan 2012 08:12:10 +0000 (00:12 -0800)
committerGlenn Morris <rgm@gnu.org>
Mon, 23 Jan 2012 08:12:10 +0000 (00:12 -0800)
* lisp/eshell/esh-util.el (eshell-read-hosts-file): Skip comment lines.

Fixes: debbugs:10549
lisp/ChangeLog
lisp/eshell/esh-util.el

index 96c187147091b7e8da83873f50f95b755137992b..297043fa12bd85be0a60d0f21548a3feab540400 100644 (file)
@@ -1,3 +1,8 @@
+2012-01-23  Mike Lamb  <mrlamb@gmail.com>  (tiny change)
+
+       * eshell/esh-util.el (eshell-read-hosts-file):
+       Skip comment lines.  (Bug#10549)
+
 2012-01-23  Juanma Barranquero  <lekktu@gmail.com>
 
        * subr.el (display-delayed-warnings): Doc fix.
index f111fd912307c76b61868f31d2604f85ab54661b..8218e91ddc7273386d626ebfcacf6f02e3822e75 100644 (file)
@@ -483,7 +483,7 @@ list."
       (insert-file-contents eshell-hosts-file)
       (goto-char (point-min))
       (while (re-search-forward
-             "^\\(\\S-+\\)\\s-+\\(\\S-+\\)\\(\\s-*\\(\\S-+\\)\\)?" nil t)
+             "^\\([^#[:space:]]+\\)\\s-+\\(\\S-+\\)\\(\\s-*\\(\\S-+\\)\\)?" nil t)
        (if (match-string 1)
            (add-to-list 'hosts (match-string 1)))
        (if (match-string 2)