about summary refs log tree commit diff
path: root/iconvdata
diff options
context:
space:
mode:
Diffstat (limited to 'iconvdata')
-rw-r--r--iconvdata/big5hkscs.c5
-rwxr-xr-xiconvdata/tst-table.sh9
-rwxr-xr-xiconvdata/tst-tables.sh15
3 files changed, 21 insertions, 8 deletions
diff --git a/iconvdata/big5hkscs.c b/iconvdata/big5hkscs.c
index e5097c75c9..316baa1e5f 100644
--- a/iconvdata/big5hkscs.c
+++ b/iconvdata/big5hkscs.c
@@ -11727,6 +11727,11 @@ static struct
 									      \
 	inptr += 2;							      \
       }									      \
+    else if (__builtin_expect (ch, 0) == 0xff)				      \
+      {									      \
+	result = __GCONV_ILLEGAL_INPUT;					      \
+	break;								      \
+      }									      \
     else								      \
       ++inptr;								      \
 									      \
diff --git a/iconvdata/tst-table.sh b/iconvdata/tst-table.sh
index 4cd2f6e29b..9b3fcc3dad 100755
--- a/iconvdata/tst-table.sh
+++ b/iconvdata/tst-table.sh
@@ -61,15 +61,18 @@ diff ${objpfx}tst-${charset}.table ${objpfx}tst-${charset}.inverse.table | \
   grep '^[<>]' | sed -e 's,^. ,,' > ${objpfx}tst-${charset}.irreversible.table
 
 # Check 1: charmap and iconv forward should be identical.
-cmp -s ${objpfx}tst-${charset}.charmap.table ${objpfx}tst-${charset}.table
+cmp -s ${objpfx}tst-${charset}.charmap.table ${objpfx}tst-${charset}.table ||
+exit 1
 
 # Check 2: the difference between the two iconv directions.
 if test -f ${irreversible}; then
   cat ${objpfx}tst-${charset}.charmap.table ${irreversible} | sort | uniq -u \
     > ${objpfx}tst-${charset}.tmp.table
-  cmp -s ${objpfx}tst-${charset}.tmp.table ${objpfx}tst-${charset}.inverse.table
+  cmp -s ${objpfx}tst-${charset}.tmp.table ${objpfx}tst-${charset}.inverse.table ||
+  exit 1
 else
-  cmp -s ${objpfx}tst-${charset}.table ${objpfx}tst-${charset}.inverse.table
+  cmp -s ${objpfx}tst-${charset}.table ${objpfx}tst-${charset}.inverse.table ||
+  exit 1
 fi
 
 exit 0
diff --git a/iconvdata/tst-tables.sh b/iconvdata/tst-tables.sh
index 202b52f09f..8692b2a86b 100755
--- a/iconvdata/tst-tables.sh
+++ b/iconvdata/tst-tables.sh
@@ -179,7 +179,7 @@ cat <<EOF |
   ISO-IR-197
   TIS-620
   KOI8-U
-  ISIRI-3342
+  #ISIRI-3342                         This charset concept is completely broken
   #
   # Multibyte encodings come here
   #
@@ -205,9 +205,14 @@ cat <<EOF |
 EOF
 while read charset charmap; do
   case ${charset} in \#*) continue;; esac
-  echo "Testing ${charset}" 1>&2
-  ./tst-table.sh ${common_objpfx} ${objpfx} ${charset} ${charmap} \
-  || { echo "failed: ./tst-table.sh ${common_objpfx} ${objpfx} ${charset} ${charmap}"; status=1; }
+  echo -n "Testing ${charset}" 1>&2
+  if ./tst-table.sh ${common_objpfx} ${objpfx} ${charset} ${charmap}; then
+    echo 1>&2
+  else
+    echo "failed: ./tst-table.sh ${common_objpfx} ${objpfx} ${charset} ${charmap}"
+    echo " *** FAILED ***" 1>&2
+    exit 1
+  fi
 done
 
-exit $status
+exit $?