Messages in this thread | | | Subject | Re: [PATCH] fat: Refactor shortname parsing | From | "Steven J. Magnani" <> | Date | Mon, 02 Jul 2012 09:00:38 -0500 |
| |
On Mon, 2012-07-02 at 22:40 +0900, OGAWA Hirofumi wrote: > "Steven J. Magnani" <steve@digidescorp.com> writes: > > > On Sat, 2012-06-30 at 05:09 +0900, OGAWA Hirofumi wrote: > >> OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> writes: > >> > >> > > >> > if (is_vfat) > >> > ptname[i++] = fat_tolower(!nocase, c); > >> > >> Of course, if (!is_vfat). Sorry. > > > > I agree that the nocase logic is confusing, but I'm pretty sure this > > change would break the code. > > I might be wrong here though, which place is broken with it? > > > 'nocase' is always zero for vfat, which does not recognize that option. > > For msdos, it is zero by default, and 1 if the 'nocase' option was > > specified. > > In all cases it is necessary to copy *something* to ptname. > > Looks like, we overwrite bufname by converted bufuname in is_vfat case? > > if (isvfat) { > bufuname[j] = 0x0000; > i = fat_uni_to_x8(sb, bufuname, bufname, sizeof(bufname)); > }
True, but with the change you suggest we lose the incrementing of 'i', which likely would cause an infinite loop for 1:1 Unicode conversions.
Steve
| |