Date: Sat, 1 Sep 2007 21:53:08 +0800 From: "Tz-Huan Huang" <tzhuan@csie.org> To: "Bruce Evans" <brde@optusnet.com.au> Cc: bugs@freebsd.org, fs@freebsd.org Subject: Re: msdosfs not MPSAFE Message-ID: <6a7033710709010653i2e43f517y953885b67160c1cd@mail.gmail.com> In-Reply-To: <20070831092907.K8647@besplex.bde.org> References: <20070712084115.GA2200@deviant.kiev.zoral.com.ua> <20070721233613.Q3366@besplex.bde.org> <20070804075730.GP2738@deviant.kiev.zoral.com.ua> <20070808004001.O926@besplex.bde.org> <20070807170259.GJ2738@deviant.kiev.zoral.com.ua> <20070810133946.H769@besplex.bde.org> <20070810124153.GW2738@deviant.kiev.zoral.com.ua> <20070814154812.J24186@besplex.bde.org> <6a7033710708300835n5ac95063o6331ede5fcc80662@mail.gmail.com> <20070831092907.K8647@besplex.bde.org>
next in thread | previous in thread | raw e-mail | index | archive | help
------=_Part_864_14572580.1188654788867 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 2007/8/31, Bruce Evans <brde@optusnet.com.au>: > This is too late. I just got approval to commit my version mailed > here on 10 Aug, and will commit it today. That version also removes > the globals, but doesn't change the algorithm so much. Your version > seems to be simpler but has too many style bugs for me. If you want > to do more work on this, please adjust your patch to apply to the > version that I will commit and clean it up. (sorry that I forgot to replay to all in the previous mail) Ok, the attachment is the new version. I think it's worth committing because it doesn't only solve the global variables problem but also solve the kiconv problem. In original interface the win2unixchr() return a 2-byte int thus it's impossible to convert from UTF-16BE to UTF-8 because the size of a character in UTF-8 may be from 1 byte to 6 bytes. Tz-Huan Huang ------=_Part_864_14572580.1188654788867 Content-Type: application/octet-stream; name=msdosfs.diff Content-Transfer-Encoding: base64 X-Attachment-Id: f_f626ch0u Content-Disposition: attachment; filename="msdosfs.diff" ZGlmZiAtdXJOIG1zZG9zZnMub3JpZy9kaXJlbnRyeS5oIG1zZG9zZnMvZGlyZW50cnkuaAotLS0g bXNkb3Nmcy5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RfbmFtbGVuID0gMDsKIAkJfQogCQli cmVsc2UoYnApOwogCX0K ------=_Part_864_14572580.1188654788867--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a7033710709010653i2e43f517y953885b67160c1cd>