Ticket #3012: diff-src-folder.diff

File diff-src-folder.diff, 1.5 KB (added by andreas_dr, 15 years ago)

fixes multibyte char usage with ls (at least) and fixes bytecount issue in Terminal App

  • apps/terminal/UTF8Char.h

     
    4141
    4242    static int32 ByteCount(char firstChar)
    4343    {
    44         // Note, this does not recognize invalid chars
    45         uint32 c = firstChar;
    46         if (c < 0x80)
    47             return 1;
    48         if (c < 0xe0)
    49             return 2;
    50         return c < 0xf0 ? 3 : 4;
     44        if ((uchar)firstChar < 128) return 1; else
     45        if ((uchar)firstChar >= 128 + 64 + 32 + 16) return 4; else
     46        if ((uchar)firstChar >= 128 + 64 + 32) return 3; else
     47        if ((uchar)firstChar >= 128 + 64) return 2; else
     48            return 0; // No valid UTF-8 Byte?
    5149    }
    5250
    5351    int32 ByteCount() const
  • bin/coreutils/lib/Jamfile

     
    9494#   lstat-stub.c
    9595#   lstat.c
    9696#   malloc.c
     97    mbchar.c
    9798    mbscasecmp.c
    9899    mbswidth.c
    99100    md5.c
     
    165166#   strncasecmp.c
    166167    strndup.c
    167168    strnlen.c
     169    strnlen1.c
    168170    strnumcmp.c
    169171#   strpbrk.c
    170172#   strstr.c
  • bin/tar/lib/Jamfile

     
    4545    imaxtostr.c
    4646    lchown.c
    4747    malloc.c
     48    mbchar.c
    4849    mbscasecmp.c
    4950    mempcpy.c
    5051    memrchr.c
     
    7677    stpcpy.c
    7778    strcasecmp.c
    7879    stripslash.c
     80    strnlen1.c
    7981    strncasecmp.c
    8082    strndup.c
    8183    strtol.c