Mercurial > emacs
diff lisp/net/ange-ftp.el @ 38328:3c2404604bae
(ange-ftp-file-modtime): Check a 213 response
from the server for the format we expect. Don't use it if it
doesn't look like what the Internet draft for FTP extensions
specifies.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Mon, 09 Jul 2001 08:57:36 +0000 |
parents | b6dd8b1368af |
children | 253f761ad37b |
line wrap: on
line diff
--- a/lisp/net/ange-ftp.el Mon Jul 09 00:49:22 2001 +0000 +++ b/lisp/net/ange-ftp.el Mon Jul 09 08:57:36 2001 +0000 @@ -3437,8 +3437,12 @@ (list 'quote "mdtm" (cadr (cdr parsed))))) (line (cdr res)) (modtime '(0 0))) - (when (string-match "^213" line) - ;; MDTM should return "213 YYYYMMDDhhmmss" GMT on success. + ;; MDTM should return "213 YYYYMMDDhhmmss" GMT on success + ;; following the Internet draft for FTP extensions. + ;; Bob@rattlesnake.com reports that is returns something different + ;; for at least one FTP server. So, let's use the response only + ;; if it matches the Internet draft. + (when (string-match "^213 [0-9]\\{14\\}$" line) (setq modtime (encode-time (string-to-number (substring line 16 18))