Mercurial > emacs
comparison lisp/ange-ftp.el @ 20453:a68e24bdc522
(ange-ftp-date-regexp): Fix the problem with misparsing
`-r--r--r-- 1 may 1997' by requiring a digit before the date.
author | Paul Eggert <eggert@twinsun.com> |
---|---|
date | Thu, 11 Dec 1997 06:58:17 +0000 |
parents | 5f8d36dfb126 |
children | 0600cc938c98 |
comparison
equal
deleted
inserted
replaced
20452:d56e496c7790 | 20453:a68e24bdc522 |
---|---|
2510 ;;;; Directory information caching support. | 2510 ;;;; Directory information caching support. |
2511 ;;;; ------------------------------------------------------------ | 2511 ;;;; ------------------------------------------------------------ |
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: |
2523 This 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 | |
2531 directory listing. This regular expression is designed to recognize dates | |
2524 regardless of the language.") | 2532 regardless of the language.") |
2525 | 2533 |
2526 (defvar ange-ftp-add-file-entry-alist nil | 2534 (defvar ange-ftp-add-file-entry-alist nil |
2527 "Alist saying how to add file entries on certain OS types. | 2535 "Alist saying how to add file entries on certain OS types. |
2528 Association list of pairs \( TYPE \. FUNC \), where FUNC | 2536 Association list of pairs \( TYPE \. FUNC \), where FUNC |