aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert1997-12-11 06:58:17 +0000
committerPaul Eggert1997-12-11 06:58:17 +0000
commitea69dc5baccd25ac2c6d25e6ab68804ec13a511d (patch)
tree84f10fd0ccf2b1ea682be1ca4e4d496bc7b400e7
parent6a5c00da3f62d9e8ec23a8dded5a47fd2a8bb9c8 (diff)
downloademacs-ea69dc5baccd25ac2c6d25e6ab68804ec13a511d.tar.gz
emacs-ea69dc5baccd25ac2c6d25e6ab68804ec13a511d.zip
(ange-ftp-date-regexp): Fix the problem with misparsing
`-r--r--r-- 1 may 1997' by requiring a digit before the date.
-rw-r--r--lisp/ange-ftp.el16
1 files changed, 12 insertions, 4 deletions
diff --git a/lisp/ange-ftp.el b/lisp/ange-ftp.el
index 8b09c7f45e7..0d395dd0402 100644
--- a/lisp/ange-ftp.el
+++ b/lisp/ange-ftp.el
@@ -2512,15 +2512,23 @@ away in the internal cache."
2512 2512
2513(defconst ange-ftp-date-regexp 2513(defconst ange-ftp-date-regexp
2514 (let* ((l "[A-Za-z\xa0-\xff]") 2514 (let* ((l "[A-Za-z\xa0-\xff]")
2515 ;; In some locales, month abbreviations are as short as 2 letters,
2516 ;; and they can be padded on the right with spaces.
2517 (month (concat l l "+ *"))
2518 ;; Recognize any non-ISO-8859 character.
2519 ;; The purpose is to match a Kanji character.
2515 (k "[^\x00-\xff]") 2520 (k "[^\x00-\xff]")
2516 (s " ") 2521 (s " ")
2517 (mm "[ 0-1][0-9]") 2522 (mm "[ 0-1][0-9]")
2518 (dd "[ 0-3][0-9]") 2523 (dd "[ 0-3][0-9]")
2519 (western (concat "\\(" l l "+ +" dd "\\|" dd s l l "+" "\\)")) 2524 (western (concat "\\(" month s dd "\\|" dd s month "\\)"))
2520 (japanese (concat mm k s dd k))) 2525 (japanese (concat mm k s dd k)))
2521 (concat s "\\(" western "\\|" japanese "\\)" s)) 2526 ;; Require the previous column to end in a digit.
2522 "Regular expression to recognize the date in a directory listing. 2527 ;; This avoids recognizing `1 may 1997' as a date in the line:
2523This regular expression is designed to recognize dates 2528 ;; -r--r--r-- 1 may 1997 1168 Oct 19 16:49 README
2529 (concat "[0-9]" s "\\(" western "\\|" japanese "\\)" s))
2530 "Regular expression to match up to the column before the file name in a
2531directory listing. This regular expression is designed to recognize dates
2524regardless of the language.") 2532regardless of the language.")
2525 2533
2526(defvar ange-ftp-add-file-entry-alist nil 2534(defvar ange-ftp-add-file-entry-alist nil