[PATCH] i18n: safety writing into non-ASCII named files on any shell implementation

Matt Mackall mpm at selenic.com
Wed Jul 21 13:19:43 CDT 2010


On Wed, 2010-07-21 at 23:32 +0900, Yuya Nishihara wrote:
> FUJIWARA Katsunori wrote:
> > # HG changeset patch
> > # User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
> > # Date 1279718904 -32400
> > # Branch stable
> > # Node ID c83103eb88b4f795a7c7068303ab1c147823e42b
> > # Parent  9e874ee0fe97ffd00fe13300f4cdf6b44921e71d
> > i18n: safety writing into non-ASCII named files on any shell implementation
> > 
> > some shell implementation (e.g.: dash) can not handle redirection into
> > non-ASCII UTF-8 named file correctly.
> 
> It works perfectly on dash.
> Thanks for caring about 8bit-unsafe shell.

FYI, I was curious how dash could get this so egregiously wrong. Turns
out that some internal escaping got half-removed rather than fully
removed. A patch is here:

http://www.mail-archive.com/dash@vger.kernel.org/msg00238.html

And released in 0.5.6.1. It apparently only affects redirection with
filenames containing 0x81 and 0x83. 

So that suggests two alternative (and simpler) ways to test:

a) pick new names without the affected bytes

or

b) redirect to a temporary file and move the temporary

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list