patch for replacing non-printable chars in filenames

Dmitry V. Levin ldv at
Tue Nov 23 22:40:58 GMT 2004


On Tue, Nov 23, 2004 at 05:29:57PM +0100, Paul Slootman wrote:
> There's a bug reported in Debian about the tty being screwed up by wierd
> filenames, see
> On the one hand, find will also do this. On the other hand, ls will
> replace such chars with a question mark. Upon inspection, it appears to
> be fairly simple to also do this in rsync (in the rwrite() function).

1. find's output is mostly for another program's input, not for tty.
2. ls does --hide-control-chars by default only if isatty (STDOUT_FILENO).

> Here's a patch. Opinions? Perhaps don't do it unconditionally, i.e.
> offer some way to turn it off?

I'd make it like ls, i.e. when descriptor is a tty; also I'd add some
option to enforce --hide-control-chars also for non-tty.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url :

More information about the rsync mailing list