27 Nov, 2011

1 commit

  • As requested by NamJae Jeon, this patch (as1503) changes the name of
    the "maxlen" parameters to "maxout" in the various UTF conversion
    routines. This should make the role of that parameter more clear.

    The patch also renames the "len" parameters to "inlen", for the same
    reason.

    Signed-off-by: Alan Stern
    Reviewed-by: NamJae Jeon
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     

19 Nov, 2011

1 commit

  • The utf8s_to_utf16s conversion routine needs to be improved. Unlike
    its utf16s_to_utf8s sibling, it doesn't accept arguments specifying
    the maximum length of the output buffer or the endianness of its
    16-bit output.

    This patch (as1501) adds the two missing arguments, and adjusts the
    only two places in the kernel where the function is called. A
    follow-on patch will add a third caller that does utilize the new
    capabilities.

    The two conversion routines are still annoyingly inconsistent in the
    way they handle invalid byte combinations. But that's a subject for a
    different patch.

    Signed-off-by: Alan Stern
    CC: Clemens Ladisch
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     

01 Oct, 2009

1 commit


24 Sep, 2009

1 commit

  • Most call sites of unload_nls() do:
    if (nls)
    unload_nls(nls);

    Check the pointer inside unload_nls() like we do in kfree() and
    simplify the call sites.

    Signed-off-by: Thomas Gleixner
    Cc: Steve French
    Cc: OGAWA Hirofumi
    Cc: Roman Zippel
    Cc: Dave Kleikamp
    Cc: Petr Vandrovec
    Cc: Anton Altaparmakov
    Signed-off-by: Al Viro

    Thomas Gleixner
     

01 Aug, 2009

1 commit

  • With utf8 option, vfat allowed the duplicated filenames.

    Normal nls returns -EINVAL for invalid char. But utf8s_to_utf16s()
    skipped the invalid char historically.

    So, this changes the utf8s_to_utf16s() directly to return -EINVAL for
    invalid char, because vfat is only user of it.

    mkdir /mnt/fatfs
    FILENAME=`echo -ne "invalidutf8char_\\0341_endofchar"`
    echo "Using filename: $FILENAME"
    dd if=/dev/zero of=fatfs bs=512 count=128
    mkdosfs -F 32 fatfs
    mount -o loop,utf8 fatfs /mnt/fatfs
    touch "/mnt/fatfs/$FILENAME"
    umount /mnt/fatfs
    mount -o loop,utf8 fatfs /mnt/fatfs
    touch "/mnt/fatfs/$FILENAME"
    ls -l /mnt/fatfs
    umount /mnt/fatfs

    ---- And the output is:

    Using filename: invalidutf8char_\0341_endofchar
    128+0 records in
    128+0 records out
    65536 bytes (66 kB) copied, 0.000388118 s, 169 MB/s
    mkdosfs 2.11 (12 Mar 2005)
    total 0
    -rwxr-xr-x 1 root root 0 Jun 28 19:46 invalidutf8char__endofchar
    -rwxr-xr-x 1 root root 0 Jun 28 19:46 invalidutf8char__endofchar

    Tested-by: Marton Balint
    Signed-off-by: OGAWA Hirofumi

    OGAWA Hirofumi
     

16 Jun, 2009

3 commits

  • This patch (as1239) updates the kernel's treatment of Unicode. The
    character-set conversion routines are well behind the current state of
    the Unicode specification: They don't recognize the existence of code
    points beyond plane 0 or of surrogate pairs in the UTF-16 encoding.

    The old wchar_t 16-bit type is retained because it's still used in
    lots of places. This shouldn't cause any new problems; if a
    conversion now results in an invalid 16-bit code then before it must
    have yielded an undefined code.

    Difficult-to-read names like "utf_mbstowcs" are replaced with more
    transparent names like "utf8s_to_utf16s" and the ordering of the
    parameters is rationalized (buffer lengths come immediate after the
    pointers they refer to, and the inputs precede the outputs).
    Fortunately the low-level conversion routines are used in only a few
    places; the interfaces to the higher-level uni2char and char2uni
    methods have been left unchanged.

    Signed-off-by: Alan Stern
    Acked-by: Clemens Ladisch
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • utf8_wcstombs forgot to include one-byte UTF-8 characters when
    calculating the output buffer size, i.e., theoretically, it was possible
    to overflow the output buffer with an input string that contains enough
    ASCII characters.

    In practice, this was no problem because the only user so far (VFAT)
    always uses a big enough output buffer.

    Signed-off-by: Clemens Ladisch
    Signed-off-by: Greg Kroah-Hartman

    Clemens Ladisch
     
  • When utf8_wcstombs encounters a character that cannot be encoded, we
    must not decrease the remaining output buffer size because nothing has
    been written to the output buffer.

    Signed-off-by: Clemens Ladisch
    Signed-off-by: Greg Kroah-Hartman

    Clemens Ladisch
     

16 Oct, 2008

1 commit


19 Oct, 2007

1 commit

  • Get rid of sparse related warnings from places that use integer as NULL
    pointer.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Stephen Hemminger
    Cc: Andi Kleen
    Cc: Jeff Garzik
    Cc: Matt Mackall
    Cc: Ian Kent
    Cc: Arnd Bergmann
    Cc: Davide Libenzi
    Cc: Stephen Smalley
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stephen Hemminger
     

17 Oct, 2007

2 commits

  • Changes NLS and DLM menus into a 'menuconfig' object so that it can be
    disabled at once without having to enter the menu first to disable the config
    option.

    Signed-off-by: Jan Engelhardt
    Cc: Steven Whitehouse
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Engelhardt
     
  • Add const modifiers to a few struct nls_table's member pointers in
    include/linux/nls.h and adds a lot of const's in fs/nls/*.c files.

    Resulting changes as visible by size:

    text data bss dec hex filename
    113612 481216 2368 597196 91ccc nls.org/built-in.o
    593548 3296 288 597132 91c8c nls/built-in.o

    Apparently compiler managed to optimize code a bit better
    because of const-ness.

    No other changes are made.

    Signed-off-by: Denys Vlasenko
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Denys Vlasenko
     

17 Jul, 2007

1 commit


08 Dec, 2006

1 commit

  • Twenty characters in cp936 are not correctly handled. They're all in the
    U00 plane. nls_cp936 converts all U00XY to XY but this is not correct for
    some characters.(e.g. U00B7 -> A1A4, U00A8 -> A1A7).

    This problem is fixed by generating u2c_00 based on all c2u_xx and changing
    uni2char() to give U00 plane a special handling. The "€"(U20AC,80 in
    cp936) is also be handled properly.

    Acked-by: Gang Chen
    Cc: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jun Chen
     

04 Oct, 2006

1 commit


02 Oct, 2006

1 commit


01 Jul, 2006

1 commit


24 Mar, 2006

1 commit

  • Use ARRAY_SIZE macro instead of sizeof(x)/sizeof(x[0]) and remove a
    duplicate of ARRAY_SIZE. Some trailing whitespaces are also deleted.

    Signed-off-by: Tobias Klauser
    Cc: David Howells
    Cc: Dave Kleikamp
    Acked-by: Trond Myklebust
    Cc: Neil Brown
    Cc: Chris Mason
    Cc: Jeff Mahoney
    Cc: Christoph Hellwig
    Cc: Nathan Scott
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tobias Klauser
     

22 Mar, 2006

1 commit


06 May, 2005

1 commit


17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds