Re: patch for replacing non-printable chars in filenames

2005-04-01 Thread Vidar Madsen
Hi. After trying this a bit, I now think it would read better to use 3-digit octal escaping. I would be perfectly fine with that. And octal is probably more in the line of how escaping is traditionally done. As long as I can process the files in the log, I'm all for it. Btw, will this change

Re: patch for replacing non-printable chars in filenames

2005-04-01 Thread Wayne Davison
On Fri, Apr 01, 2005 at 10:26:18AM +0200, Vidar Madsen wrote: Btw, will this change make it into a later rsync version ? Yes, I've just committed it for 2.6.5. Now I need to add configure checking for setlocale() and locale.h. ..wayne.. -- To unsubscribe or change options:

Re: patch for replacing non-printable chars in filenames

2005-03-31 Thread Vidar Madsen
Hi. Sorry about picking up a rather ancient thread, but this didn't bite me until now (when I upgraded to 2.6.4); Wayne wrote: I've also checked in an improvement to safe_fname() that makes it use isprint() (instead of just looking for newlines). Is there a chance that this feature will

Re: patch for replacing non-printable chars in filenames

2005-03-31 Thread Vidar Madsen
Oops, I should have added that for isprint() (in safe_fname()) to be locale-aware at all, you need to add a call to setlocale(LC_CTYPE, ). Vidar -- To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync Before posting, read:

Re: patch for replacing non-printable chars in filenames

2005-03-31 Thread Wayne Davison
On Thu, Mar 31, 2005 at 01:17:16PM +0200, Vidar Madsen wrote: Alternatively, how about escaping the chars instead of just munging them? I.e. output files like two-line\x0afile name or P\xe5ske (norwegian for easter, for the curious;), or something like that? I'd be fine with that. It would

Re: patch for replacing non-printable chars in filenames

2005-03-31 Thread Wayne Davison
On Thu, Mar 31, 2005 at 08:13:52AM -0800, Wayne Davison wrote: Appended is a patch that does the suggested escaping. Actually, that patch didn't put the suggested 'x' in after the '\'. After trying this a bit, I now think it would read better to use 3-digit octal escaping. That would turn a \n

Re: patch for replacing non-printable chars in filenames

2005-02-07 Thread Wayne Davison
On Thu, Nov 25, 2004 at 11:27:58AM +0100, Paul Slootman wrote: Not all filenames that are printed are passed through safe_fname() AFAICS, e.g. a random piece of code from rsync.c:166 : I looked at eliminating safe_fname() in favor of putting the filtering into rwrite(), and there are a bunch of

Re: patch for replacing non-printable chars in filenames

2004-11-26 Thread Stefan Nehlsen
On Tue, Nov 23, 2004 at 05:29:57PM +0100, Paul Slootman wrote: +/* Replace non-printing chars in the string, most probably due to + * wierd filenames. Skip the first and last chars, they may be \n */ +int i; +for (i=1; ilen-1; i++) +

Re: patch for replacing non-printable chars in filenames

2004-11-26 Thread Paul Slootman
On Fri 26 Nov 2004, Stefan Nehlsen wrote: On Tue, Nov 23, 2004 at 05:29:57PM +0100, Paul Slootman wrote: +/* Replace non-printing chars in the string, most probably due to + * wierd filenames. Skip the first and last chars, they may be \n */ +int i;

Re: patch for replacing non-printable chars in filenames

2004-11-25 Thread Paul Slootman
On Tue 23 Nov 2004, Wayne Davison wrote: On Tue, Nov 23, 2004 at 05:29:57PM +0100, Paul Slootman wrote: Here's a patch. Opinions? I think that a better place to munge the name would be in the safe_fname() routine in utils.c (which already munges newlines characters into question marks).

patch for replacing non-printable chars in filenames

2004-11-23 Thread Paul Slootman
There's a bug reported in Debian about the tty being screwed up by wierd filenames, see http://bugs.debian.org/bug=242300 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

Re: patch for replacing non-printable chars in filenames

2004-11-23 Thread Wayne Davison
On Tue, Nov 23, 2004 at 05:29:57PM +0100, Paul Slootman wrote: Here's a patch. Opinions? I think that a better place to munge the name would be in the safe_fname() routine in utils.c (which already munges newlines characters into question marks). The reason I didn't change any other characters

Re: patch for replacing non-printable chars in filenames

2004-11-23 Thread Dmitry V. Levin
Hi, 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 http://bugs.debian.org/bug=242300 On the one hand, find will also do this. On the other hand, ls will replace such chars with a question