From: Edgar Toernig Date: Thu, 28 Apr 2005 01:13:02 GMT Subject: Re: git pull on ia64 linux tree Message-ID: <20050428031302.50fbe006.froese@gmx.de> In-Reply-To: Linus Torvalds wrote: > > One problem with this is that "grep" always thinks lines end in '\n', and > what we'd really want (from a scriptability angle) is > > diff-tree -z -r $orig $final | grep -0 '^-' Don't you think it's much easier to reject filenames with control chars? Forget all this -z/-0 stuff. It only complicates life and supporting filenames with embedded newlines is useless in practice. --- x/update-cache.c Thu Apr 21 19:58:47 2005 +++ y/update-cache.c Thu Apr 28 02:55:27 2005 @@ -227,7 +227,8 @@ * are hidden, for chist sake. * * Also, we don't want double slashes or slashes at the - * end that can make pathnames ambiguous. + * end that can make pathnames ambiguous nor any control + * chars. */ static int verify_path(char *path) { @@ -237,6 +238,8 @@ for (;;) { if (!c) return 1; + if ((unsigned char)c < 32) + return 0; if (c == '/') { inside: c = *path++; Ciao, ET.