lavv17 / lftp

sophisticated command line file transfer program (ftp, http, sftp, fish, torrent)
http://lftp.yar.ru
GNU General Public License v3.0
1.11k stars 162 forks source link

Escaping characters in file name, mirror doesn't follow standard bash escape #736

Open deze333 opened 1 month ago

deze333 commented 1 month ago

Example filename:

Filename - 1234 'Red' [456] (ABC)

Escaped for Bash:

Filename\ -\ 1234\ \'Red\'\ \[456\]\ \(ABC\)

But mirror command doesn't unescape all escaped characters:

mirror: Access failed: No such file (/Filename - 1234 'Red' \[456\] \(ABC\))

The only way to make mirror work is to skip escaping brackets, like so:

Filename\ -\ 1234\ \'Red\'\ [456]\ (ABC)

But that seem to be a non-standard escape scheme.

Also, some characters like " even if escaped just disappear from the filename when parsed by mirror.