[patch] Re: 2.2.16pre nls in 2.3?

From: Urban Widmark (urban@svenskatest.se)
Date: Sat May 20 2000 - 11:49:37 EDT

  • Next message: Riley Williams: "Re: IDE-SCSI in 2.2.1[45]"

    On Fri, 19 May 2000, Alan Cox wrote:

    > I dont know. Feel free to forward port it

    Ok.

    http://www.hojdpunkten.ac.se/054/nls16-2.3.99-pre9-2.patch.gz

    Touches fat/vfat, isofs, ntfs, ncpfs (and nls). Please test if you are
    using any of them with non us-ascii. They are not supposed to behave
    differently, only be a little more prepared for 16bit charsets.

    Maintainers should be on the Cc list, please complain/fix if I messed up
    your code (hope I didn't miss anyone).

    Notes:
    + Added returnvalue from 'uni2char' to allow the caller to know if the
      conversion failed.
    + The 2.3 conversion between upper/lower case should probably be changed
      to a function to work for the new codepages.
    + New codepages not included (since they are huge!), but they are easily
      added.
    + Most of this is not tested very well as I don't use most of these
      filesystems with non us-ascii, but the changes are mostly the same as
      in 2.2.16-pre1.
    + I have made a small testprogram to try and test my changes,
      (http://www.hojdpunkten.ac.se/054/nls-test.tgz, unpack in linux/fs/nls)
    + I choose to use iso8859-1 as the default value for "CONFIG_NLS_DEFAULT"
      since all the strings that are replaced with this CONFIG_ were
      iso8859-1.
      (and I think Andrzej is right about vfat nls_disk/nls_io. nls_disk is
       what the chars are on disk, nls_io is for talking to "userspace". But I
       could have misunderstood the code or him ... or both :)

    While testing this I ran across what I believe are two minor bugs in
    2.2.16-preX. Patch below.

    /Urban

    diff -ur --exclude-from=exclude linux-2.2.16-pre2-orig/fs/fat/dir.c linux-2.2.16-pre2-nls/fs/fat/dir.c
    --- linux-2.2.16-pre2-orig/fs/fat/dir.c Fri May 5 21:32:37 2000
    +++ linux-2.2.16-pre2-nls/fs/fat/dir.c Sat May 20 16:43:27 2000
    @@ -89,9 +89,9 @@
                             op += 3;
                     }
                     else{
    - ip += 2;
                             op += len;
                     }
    + ip += 2;
                     /* We have some slack there, so it's OK */
                     if (op>ascii+256) {
                             op = ascii + 256;
    diff -ur --exclude-from=exclude linux-2.2.16-pre2-orig/fs/isofs/joliet.c linux-2.2.16-pre2-nls/fs/isofs/joliet.c
    --- linux-2.2.16-pre2-orig/fs/isofs/joliet.c Fri May 5 21:32:37 2000
    +++ linux-2.2.16-pre2-nls/fs/isofs/joliet.c Sat May 20 16:45:07 2000
    @@ -27,7 +27,7 @@
     
             while ((*ip || ip[1]) && len) {
                     int llen;
    - nls->uni2char(ip[0], ip[1], op, 20, &llen);
    + nls->uni2char(ip[1], ip[0], op, 20, &llen);
                     op += llen;
                     ip += 2;
                     len--;

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.rutgers.edu
    Please read the FAQ at http://www.tux.org/lkml/



    This archive was generated by hypermail 2b29 : Sat May 20 2000 - 11:54:37 EDT