Andreas Schwab writes: > Rasmus writes: > >> diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el >> index d7632ed..5e9bc27 100644 >> --- a/lisp/net/ange-ftp.el >> +++ b/lisp/net/ange-ftp.el >> @@ -2831,16 +2831,20 @@ match subdirectories as well.") >> files ange-ftp-files-hashtable))) >> >> (defun ange-ftp-switches-ok (switches) >> - "Return SWITCHES (a string) if suitable for our use." >> + "Return SWITCHES (a string) if suitable for use with ls over ftp." >> (and (stringp switches) >> ;; We allow the A 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) >> + ;; Allow flags starting with a single dash >> (string-match "\\(\\`\\| \\)-[[:alpha:]]*l" switches) >> + ;; Disallow recursive flag >> (not (string-match >> - "--recursive\\>\\|\\(\\`\\| \\)-[[:alpha:]]*R" switches)) >> + "\\(\\`\\| \\)-[[:alpha:]]*R" switches)) >> + ;; Disallow long flags. >> + (not (string-match "--\\w\\{2,\\}")) > > This contradicts the first string-match. You are right. How about this one: allow --(almost-)all for legacy reasons. Disallow other long flags. Allow short flag as long as their is an "l" and not an "R"? (At least that was the intention). —Rasmus -- Together we will make the possible totalllly impossible!