Re: [LEDE-DEV] [PATCH] jshn: add functionality to read big JSON
On Sat, Nov 18, 2017 at 3:55 PM, Christian Beier wrote: > Am Fri, 17 Nov 2017 09:17:39 +0200 > schrieb Alexandru Ardelean : > >> On Thu, Nov 16, 2017 at 8:52 PM, Christian Beier >> wrote: >> > The existing read functionality feeds the complete JSON to jshn as a >> > cmdline argument, leading to `-ash: jshn: Argument list too long` >> > errors for JSONs bigger than ca. 100KB. >> > >> > This commit adds the ability to read the JSON directly from a file if >> > wanted, removing this shell-imposed size limit. >> > >> > Tested on x86-64 and ar71xx. An mmap()-based solution was also evaluated, >> > but found to make no performance difference on either platform. >> > >> > Signed-off-by: Christian Beier >> > --- >> > jshn.c | 30 -- >> > sh/jshn.sh | 4 >> > 2 files changed, 32 insertions(+), 2 deletions(-) >> > >> > diff --git a/jshn.c b/jshn.c >> > index 79136dd..a3866a0 100644 >> > --- a/jshn.c >> > +++ b/jshn.c >> > @@ -25,6 +25,8 @@ >> > #include >> > #include >> > #include >> > +#include >> > +#include >> > #include "list.h" >> > >> > #include "avl.h" >> > @@ -300,7 +302,7 @@ out: >> > >> > static int usage(const char *progname) >> > { >> > - fprintf(stderr, "Usage: %s [-n] [-i] -r |-w\n", progname); >> > + fprintf(stderr, "Usage: %s [-n] [-i] -r |-R |-w\n", >> > progname); return 2; >> > } >> > >> > @@ -333,6 +335,10 @@ int main(int argc, char **argv) >> > struct env_var *vars; >> > int i; >> > int ch; >> > + int fd; >> > + struct stat sb; >> > + char *fbuf; >> > + int ret; >> > >> > avl_init(&env_vars, avl_strcmp_var, false, NULL); >> > for (i = 0; environ[i]; i++); >> > @@ -354,7 +360,7 @@ int main(int argc, char **argv) >> > avl_insert(&env_vars, &vars[i].avl); >> > } >> > >> > - while ((ch = getopt(argc, argv, "p:nir:w")) != -1) { >> > + while ((ch = getopt(argc, argv, "p:nir:R:w")) != -1) { >> > switch(ch) { >> > case 'p': >> > var_prefix = optarg; >> > @@ -362,6 +368,26 @@ int main(int argc, char **argv) >> > break; >> > case 'r': >> > return jshn_parse(optarg); >> > + case 'R': >> > + if((fd = open(optarg, O_RDONLY)) == -1) { >> > + fprintf(stderr, "Error opening %s\n", optarg); >> > + return 3; >> > + } >> > + if (fstat(fd, &sb) == -1) { >> > + fprintf(stderr, "Error getting size of %s\n", >> > optarg); >> > + close(fd); >> > + return 3; >> > + } >> > + if(!(fbuf = malloc(sb.st_size)) || read(fd, fbuf, >> > sb.st_size) != sb.st_size) { >> > + fprintf(stderr, "Error reading %s\n", optarg); >> > + free(fbuf); >> > + close(fd); >> > + return 3; >> > + } >> > + ret = jshn_parse(fbuf); >> > + free(fbuf); >> > + close(fd); >> > + return ret; >> nitpick/preference: I would move this code into a file, so that the >> case statement is not too loaded >> it would allow for a simpler/cleaner code-path with some goto >> statements [if put into a function] > > Yeah, I tried keeping all those error case printf and return blocks as minimal > as possible, though it still boils down to 3. Might be an idea to factor out > the > file-opening-and-reading into a separate function to keep the switch statement > cleaner, but then OTOH it'd be a function with only one caller. > > Also, I was unsure if it'd be overkill to assign different exit codes to the > different error conditions, so I simply used the first unused one (3) for all > of them. > >> >> > case 'w': >> > return jshn_format(no_newline, indent); >> > case 'n': >> > diff --git a/sh/jshn.sh b/sh/jshn.sh >> > index bf76edb..0a146e1 100644 >> > --- a/sh/jshn.sh >> > +++ b/sh/jshn.sh >> > @@ -174,6 +174,10 @@ json_load() { >> > eval "`jshn -r "$1"`" >> > } >> > >> > +json_load_file() { >> > + eval "`jshn -R "$1"`" >> would it be an idea to try to use $JSON_PREFIX here ? >> for cases when you need to change the JSON namespace, the JSON_PREFIX >> var is used if available >> it would definitely complete this function > > TBH, I don't really know what JSON_PREFIX is for. I simply used the existing > json_load() function as a blueprint. oh right ; disregard what i was saying ; i was looking at the json_dump() function JSON_PREFIX is used for changing the namespace; that allows to load into shell vars multiple JSON instances, and switch between them with the
[LEDE-DEV] [PATCH 2/4] base-files: upgrade: make get_partitions() endian agnostic
This patch fixes two issues with the current get_partitions() function. First: "Invalid partition table on $disk" will pop up on legitimate images on big endian system. This is because the little-endian representation of "55 AA" is assumed in the context of little-endian architectures. On these comparing it to the 16-bit word 0xAA55 does work as intented. Whereas on big-endian systems, this would have to be 0x55AA. This patch fixes the issue by replacing the integer conversion and value match check with just a string comparision. Second: The extraction of the type, start LBA and LBA num from the partition table has the same endianness issue. This has been fixed by using the new hex_le32_to_cpu() function. This function will translate the stored little-endian data to the correct byte-order if necessary. Signed-off-by: Christian Lamparter --- package/base-files/files/lib/upgrade/common.sh | 18 +- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/package/base-files/files/lib/upgrade/common.sh b/package/base-files/files/lib/upgrade/common.sh index 428ec735d6..71cffc8587 100644 --- a/package/base-files/files/lib/upgrade/common.sh +++ b/package/base-files/files/lib/upgrade/common.sh @@ -160,6 +160,14 @@ export_partdevice() { return 1 } +hex_le32_to_cpu() { + [ "$(echo 01 | hexdump -v -n 2 -e '/2 "%x"')" == "3031" ] && { + echo "${1:0:2}${1:8:2}${1:6:2}${1:4:2}${1:2:2}" + return + } + echo "$@" +} + get_partitions() { # local disk="$1" local filename="$2" @@ -167,8 +175,8 @@ get_partitions() { # if [ -b "$disk" -o -f "$disk" ]; then v "Reading partition table from $filename..." - local magic="$(hexdump -v -n 2 -s 0x1FE -e '1/2 "0x%04X"' "$disk")" - if [ "$magic" != 0xAA55 ]; then + local magic=$(dd if="$disk" bs=2 count=1 skip=255 2>/dev/null) + if [ "$magic" != $'\x55\xAA' ]; then v "Invalid partition table on $disk" exit fi @@ -179,9 +187,9 @@ get_partitions() { # for part in 1 2 3 4; do set -- $(hexdump -v -n 12 -s "$((0x1B2 + $part * 16))" -e '3/4 "0x%08X "' "$disk") - local type="$(($1 % 256))" - local lba="$(($2))" - local num="$(($3))" + local type="$(( $(hex_le32_to_cpu $1) % 256))" + local lba="$(( $(hex_le32_to_cpu $2) ))" + local num="$(( $(hex_le32_to_cpu $3) ))" [ $type -gt 0 ] || continue -- 2.15.0 ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
[LEDE-DEV] [PATCH 3/4] wireless-regdb: fix PKG_MIRROR_HASH
make check complains about PKG_MIRROR_HASH of the wireless-regdb package: WARNING: PKG_MIRROR_HASH does not match wireless-regdb-2017-10-20-4343d359.tar.xz hash 5f5b669f32ae36cb65b1d99efbbbfd42c2983cda32f6448346e3e54ffaba3889 Signed-off-by: Christian Lamparter --- package/firmware/wireless-regdb/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/firmware/wireless-regdb/Makefile b/package/firmware/wireless-regdb/Makefile index fa732b2d38..d06da2c708 100644 --- a/package/firmware/wireless-regdb/Makefile +++ b/package/firmware/wireless-regdb/Makefile @@ -6,7 +6,7 @@ PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git PKG_SOURCE_DATE:=2017-10-20 PKG_SOURCE_VERSION:=4343d359ed5e7404de8803a74df186457b26ab79 -PKG_MIRROR_HASH:=b827bf760de57b907df159c8d38d7c3fb5b4a691781114c47739e20bffb3a312 +PKG_MIRROR_HASH:=5f5b669f32ae36cb65b1d99efbbbfd42c2983cda32f6448346e3e54ffaba3889 PKG_MAINTAINER:=Felix Fietkau -- 2.15.0 ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
[LEDE-DEV] [PATCH 4/4] toolchain: musl: update to current HEAD
Changes: 72656157 fix fgetwc when decoding a character that crosses buffer boundary a223dbd2 add reverse iconv mappings for JIS-based encodings 105eff9d generalize iconv framework for 8-bit codepages a71b46cf fix malloc state corruption when ldso rejects loading a second libc d060edf6 reformat cjk iconv tables to be diff-friendly, match tool output c21051e9 prevent fork's errno from being clobbered by atfork handlers a39f20bf add iso-2022-jp support (decoding only) to iconv 5b546faa add iconv framework for decoding stateful encodings 0df5b39a simplify/optimize iconv utf-8 case 9eb6dd51 handle ascii range individually in each iconv case bff59d13 move iconv_close to its own translation unit 79f49eff refactor iconv conversion descriptor encoding/decoding 30fdda6c fix getaddrinfo error code for non-numeric service with AI_NUMERICSERV 67b29947 fix mismatched type of __pthread_tsd_run_dtors weak definition 13935337 s390x: use generic ioctl.h 4dc44ce8 microblaze: add statx syscall from linux v4.13 ffd048a0 aarch64: add extra_context struct from linux v4.13 6651ef1f add new tcp.h socket options from linux v4.13 14ced228 add new fcntl.h macros from linux v4.13 754f66af ioctl TIOCGPTPEER from linux v4.13 c35a8bf4 add SO_ getsockopt options from linux v4.13 5daaed6a s390x: add syscall number for s390_guarded_storage from linux v4.12 2dc6760f i386: add arch_prctl syscall number from linux v4.12 840d45be aarch64: add new HWCAP_* flags from linux v4.12 4c811227 add ARPHDR_VSOCKMON from linux v4.12 54f04d99 add new SO_ socket options from linux v4.12 9864f60e add statx syscall numbers from linux v4.11 c519658c add TCP_NLA_* enums from linux v4.11 ee3ae782 add TCP_FASTOPEN_CONNECT tcp socket option from linux v4.11 3eb82f73 add ETH_P_IBOE from linux v4.11 bd1560f6 update aarch64 hwcap.h for linux v4.11 cee73f0c add kexec_file_load syscall number on powerpc from linux v4.10 8f569557 add microblaze syscall numbers from linux v4.10 d8004030 add TFD_TIMER_CANCEL_ON_SET that timerfd.h was missing f5638c22 add ETH_MIN_MTU and ETH_MAX_MTU from linux v4.10 01369691 add IP_RECVFRAGSIZE and IPV6_RECVFRAGSIZE from linux v4.10 5c596ed8 add SCM_TIMESTAMPING_OPT_STATS and related TCP_ enums from linux v4.10 6fc6ca1a adjust posix_spawn dup2 action behavior to match future requirements Cc: Syrone Wong Signed-off-by: Christian Lamparter --- toolchain/musl/common.mk | 4 +- toolchain/musl/patches/900-iconv_size_hack.patch | 70 +--- 2 files changed, 53 insertions(+), 21 deletions(-) diff --git a/toolchain/musl/common.mk b/toolchain/musl/common.mk index 2a61516372..a94a475571 100644 --- a/toolchain/musl/common.mk +++ b/toolchain/musl/common.mk @@ -13,8 +13,8 @@ PKG_RELEASE=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE_VERSION:=eb03bde2f24582874cb72b56c7811bf51da0c817 -PKG_MIRROR_HASH:=150808458007eeb0b977059f36f88127d1a1e80ddb6ad1837b5a63efd2958e34 +PKG_SOURCE_VERSION:=72656157f54c47277b01ec85a6ba7c4084fea6c8 +PKG_MIRROR_HASH:=a3d857c23c94aa96a4ad5f442aaf236e5a189a717273c4e4faf425988d98cd32 PKG_SOURCE_URL:=git://git.musl-libc.org/musl PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz diff --git a/toolchain/musl/patches/900-iconv_size_hack.patch b/toolchain/musl/patches/900-iconv_size_hack.patch index db18fceb17..41cff5b033 100644 --- a/toolchain/musl/patches/900-iconv_size_hack.patch +++ b/toolchain/musl/patches/900-iconv_size_hack.patch @@ -1,14 +1,14 @@ --- a/src/locale/iconv.c +++ b/src/locale/iconv.c -@@ -39,6 +39,7 @@ static const unsigned char charmaps[] = +@@ -42,6 +42,7 @@ static const unsigned char charmaps[] = "ucs4\0ucs4be\0utf32\0utf32be\0\0\300" "ucs4le\0utf32le\0\0\303" "ascii\0usascii\0iso646\0iso646us\0\0\307" +#ifdef FULL_ICONV "eucjp\0\0\320" "shiftjis\0sjis\0\0\321" - "gb18030\0\0\330" -@@ -46,6 +47,7 @@ static const unsigned char charmaps[] = + "iso2022jp\0\0\322" +@@ -50,6 +51,7 @@ static const unsigned char charmaps[] = "gb2312\0\0\332" "big5\0bigfive\0cp950\0big5hkscs\0\0\340" "euckr\0ksc5601\0ksx1001\0cp949\0\0\350" @@ -16,7 +16,7 @@ #include "codepages.h" ; -@@ -53,6 +55,7 @@ static const unsigned short legacy_chars +@@ -60,6 +62,7 @@ static const unsigned short legacy_chars #include "legacychars.h" }; @@ -24,45 +24,77 @@ static const unsigned short jis0208[84][94] = { #include "jis0208.h" }; -@@ -72,6 +75,7 @@ static const unsigned short hkscs[] = { +@@ -79,6 +82,7 @@ static const unsigned short hkscs[] = { static const unsigned short ksc[93][94] = { #include "ksc.h" }; +#endif - static int fuzzycmp(const unsigned char *a, const unsigned char *b) + static const unsigned short rev_jis[] = { + #include "revjis.h" +@@ -196,6 +200,7 @@ static unsigned legacy_map(const unsigne + return x < 256 ? x : legacy_chars[x-256]; + } + ++#ifdef FULL_ICONV + static unsigned uni_to_jis(unsigned c) + { + unsigned nel = sizeof rev_jis / sizeof *rev_jis; +@@ -21
[LEDE-DEV] [PATCH 1/4] firmware: ath10k-firmware: update QCA4019 firmware to 10.4-3.2.1-00058
This patch updates ath10k-firmware to use the firmware-5.bin_10.4-3.2.1-00058 firmware for the QCA4019. Cc: Hauke Mehrtens Signed-off-by: Christian Lamparter --- package/firmware/ath10k-firmware/Makefile | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/firmware/ath10k-firmware/Makefile b/package/firmware/ath10k-firmware/Makefile index 9a34ac3155..1c6f4dfb7f 100644 --- a/package/firmware/ath10k-firmware/Makefile +++ b/package/firmware/ath10k-firmware/Makefile @@ -8,9 +8,9 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ath10k-firmware -PKG_SOURCE_DATE:=2017-03-29 -PKG_SOURCE_VERSION:=956e2609b7e42c8c710bba10ef925a5be1be5137 -PKG_MIRROR_HASH:=25f724ff38c830281b3efba4a4ddffaae0c4bd8fea0f4c1061591229ff05535b +PKG_SOURCE_DATE:=2017-10-30 +PKG_SOURCE_VERSION:=476a2850b1e8582d51187799d7de209daf1a57b2 +PKG_MIRROR_HASH:=77ba59f75c5897c842c5c525945de019fd23f1e2d8bea6239924857e500bf73a PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git @@ -223,7 +223,7 @@ define Package/ath10k-firmware-qca4019/install $(PKG_BUILD_DIR)/QCA4019/hw1.0/board-2.bin \ $(1)/lib/firmware/ath10k/QCA4019/hw1.0/ $(INSTALL_DATA) \ - $(PKG_BUILD_DIR)/QCA4019/hw1.0/3.2.1/firmware-5.bin_10.4-3.2.1-00053 \ + $(PKG_BUILD_DIR)/QCA4019/hw1.0/3.2.1/firmware-5.bin_10.4-3.2.1-00058 \ $(1)/lib/firmware/ath10k/QCA4019/hw1.0/firmware-5.bin endef -- 2.15.0 ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
[LEDE-DEV] opkg-lede not handling ar-ipks or debs anymore - bug or feature?
Hi LEDE people, I noticed that the LEDE fork of opkg does not install ar-packed .ipk files nor .debs anymore and tracked this down to [1]. What is the official roadmap/intended-way-to-go regarding opkg-lede being able to install ar-packed .ipks and .debs? The opkg-lede package description still states it's able to handle Debian packages as well [2]. As [1] broke backwards-compatibility and we kinda depend on it, I'd personally love to have ar-ipk/deb handling back, but if this break was intentional, I have to accept it and work around it somehow. Cheers, Christian [1] https://git.lede-project.org/?p=project/opkg-lede.git;a=commit;h=dd4c78aa88efd3b9cf516030937c684814df7962 [2] https://git.lede-project.org/?p=source.git;a=blob;f=package/system/opkg/Makefile;h=499de217cc537c7c279fb2c126de2c2207621865;hb=HEAD#l64 pgpJygH1SfCl5.pgp Description: Digitale Signatur von OpenPGP ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
Re: [LEDE-DEV] [PATCH 4/4] toolchain: musl: update to current HEAD
Hi, Any specific reason to introduce these changes? Best Regards, Syrone Wong On Mon, Nov 20, 2017 at 12:19 AM, Christian Lamparter wrote: > Changes: > > 72656157 fix fgetwc when decoding a character that crosses buffer boundary > a223dbd2 add reverse iconv mappings for JIS-based encodings > 105eff9d generalize iconv framework for 8-bit codepages > a71b46cf fix malloc state corruption when ldso rejects loading a second libc > d060edf6 reformat cjk iconv tables to be diff-friendly, match tool output > c21051e9 prevent fork's errno from being clobbered by atfork handlers > a39f20bf add iso-2022-jp support (decoding only) to iconv > 5b546faa add iconv framework for decoding stateful encodings > 0df5b39a simplify/optimize iconv utf-8 case > 9eb6dd51 handle ascii range individually in each iconv case > bff59d13 move iconv_close to its own translation unit > 79f49eff refactor iconv conversion descriptor encoding/decoding > 30fdda6c fix getaddrinfo error code for non-numeric service with > AI_NUMERICSERV > 67b29947 fix mismatched type of __pthread_tsd_run_dtors weak definition > 13935337 s390x: use generic ioctl.h > 4dc44ce8 microblaze: add statx syscall from linux v4.13 > ffd048a0 aarch64: add extra_context struct from linux v4.13 > 6651ef1f add new tcp.h socket options from linux v4.13 > 14ced228 add new fcntl.h macros from linux v4.13 > 754f66af ioctl TIOCGPTPEER from linux v4.13 > c35a8bf4 add SO_ getsockopt options from linux v4.13 > 5daaed6a s390x: add syscall number for s390_guarded_storage from linux v4.12 > 2dc6760f i386: add arch_prctl syscall number from linux v4.12 > 840d45be aarch64: add new HWCAP_* flags from linux v4.12 > 4c811227 add ARPHDR_VSOCKMON from linux v4.12 > 54f04d99 add new SO_ socket options from linux v4.12 > 9864f60e add statx syscall numbers from linux v4.11 > c519658c add TCP_NLA_* enums from linux v4.11 > ee3ae782 add TCP_FASTOPEN_CONNECT tcp socket option from linux v4.11 > 3eb82f73 add ETH_P_IBOE from linux v4.11 > bd1560f6 update aarch64 hwcap.h for linux v4.11 > cee73f0c add kexec_file_load syscall number on powerpc from linux v4.10 > 8f569557 add microblaze syscall numbers from linux v4.10 > d8004030 add TFD_TIMER_CANCEL_ON_SET that timerfd.h was missing > f5638c22 add ETH_MIN_MTU and ETH_MAX_MTU from linux v4.10 > 01369691 add IP_RECVFRAGSIZE and IPV6_RECVFRAGSIZE from linux v4.10 > 5c596ed8 add SCM_TIMESTAMPING_OPT_STATS and related TCP_ enums from linux > v4.10 > 6fc6ca1a adjust posix_spawn dup2 action behavior to match future requirements > > Cc: Syrone Wong > Signed-off-by: Christian Lamparter > --- > toolchain/musl/common.mk | 4 +- > toolchain/musl/patches/900-iconv_size_hack.patch | 70 > +--- > 2 files changed, 53 insertions(+), 21 deletions(-) > > diff --git a/toolchain/musl/common.mk b/toolchain/musl/common.mk > index 2a61516372..a94a475571 100644 > --- a/toolchain/musl/common.mk > +++ b/toolchain/musl/common.mk > @@ -13,8 +13,8 @@ PKG_RELEASE=1 > > PKG_SOURCE_PROTO:=git > PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) > -PKG_SOURCE_VERSION:=eb03bde2f24582874cb72b56c7811bf51da0c817 > -PKG_MIRROR_HASH:=150808458007eeb0b977059f36f88127d1a1e80ddb6ad1837b5a63efd2958e34 > +PKG_SOURCE_VERSION:=72656157f54c47277b01ec85a6ba7c4084fea6c8 > +PKG_MIRROR_HASH:=a3d857c23c94aa96a4ad5f442aaf236e5a189a717273c4e4faf425988d98cd32 > PKG_SOURCE_URL:=git://git.musl-libc.org/musl > PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz > > diff --git a/toolchain/musl/patches/900-iconv_size_hack.patch > b/toolchain/musl/patches/900-iconv_size_hack.patch > index db18fceb17..41cff5b033 100644 > --- a/toolchain/musl/patches/900-iconv_size_hack.patch > +++ b/toolchain/musl/patches/900-iconv_size_hack.patch > @@ -1,14 +1,14 @@ > --- a/src/locale/iconv.c > +++ b/src/locale/iconv.c > -@@ -39,6 +39,7 @@ static const unsigned char charmaps[] = > +@@ -42,6 +42,7 @@ static const unsigned char charmaps[] = > "ucs4\0ucs4be\0utf32\0utf32be\0\0\300" > "ucs4le\0utf32le\0\0\303" > "ascii\0usascii\0iso646\0iso646us\0\0\307" > +#ifdef FULL_ICONV > "eucjp\0\0\320" > "shiftjis\0sjis\0\0\321" > - "gb18030\0\0\330" > -@@ -46,6 +47,7 @@ static const unsigned char charmaps[] = > + "iso2022jp\0\0\322" > +@@ -50,6 +51,7 @@ static const unsigned char charmaps[] = > "gb2312\0\0\332" > "big5\0bigfive\0cp950\0big5hkscs\0\0\340" > "euckr\0ksc5601\0ksx1001\0cp949\0\0\350" > @@ -16,7 +16,7 @@ > #include "codepages.h" > ; > > -@@ -53,6 +55,7 @@ static const unsigned short legacy_chars > +@@ -60,6 +62,7 @@ static const unsigned short legacy_chars > #include "legacychars.h" > }; > > @@ -24,45 +24,77 @@ > static const unsigned short jis0208[84][94] = { > #include "jis0208.h" > }; > -@@ -72,6 +75,7 @@ static const unsigned short hkscs[] = { > +@@ -79,6 +82,7 @@ static const unsigned short hkscs[] = { > static const unsigned short ksc[93][94] = { > #include "ksc.h" > }; > +#endif > > - static int fuzzycmp(const unsi