Function: ange-ftp-switches-ok
ange-ftp-switches-ok is a byte-compiled function defined in
ange-ftp.el.gz.
Signature
(ange-ftp-switches-ok SWITCHES)
Documentation
Return SWITCHES (a string) if suitable for use with ls over ftp.
Source Code
;; Defined in /usr/src/emacs/lisp/net/ange-ftp.el.gz
(defun ange-ftp-switches-ok (switches)
"Return SWITCHES (a string) if suitable for use with ls over ftp."
(and (stringp switches)
;; We allow the --almost-all switch, which lists all files
;; except "." and "..". This is OK because we manually
;; insert these entries in the hash table.
(string-match
"--\\(almost-\\)?all\\>\\|\\(\\`\\| \\)-[[:alpha:]]*[aA]"
switches)
;; Disallow other long flags except --(almost-)all.
(not (string-match "\\(\\`\\| \\)--\\w+"
(replace-regexp-in-string
"--\\(almost-\\)?all\\>" ""
switches)))
;; Must include 'l'.
(string-match "\\(\\`\\| \\)-[[:alpha:]]*l" switches)
;; Disallow recursive flag.
(not (string-match
"\\(\\`\\| \\)-[[:alpha:]]*R" switches))
switches))