From 64c1ebb1c2d42898bd16b3cbdea28314a1a41013 Mon Sep 17 00:00:00 2001 From: Akira Kakuto Date: Mon, 18 Sep 2017 13:14:50 +0000 Subject: dvipdfm-x: Fixe a bug that only last specified OTL GSUB feature was enabled (by S. Hirata) git-svn-id: svn://tug.org/texlive/trunk@45330 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/dvipdfm-x/ChangeLog | 8 +++++- Build/source/texk/dvipdfm-x/configure | 22 +++++++-------- Build/source/texk/dvipdfm-x/configure.ac | 2 +- Build/source/texk/dvipdfm-x/tt_gsub.c | 46 +++++++++++++++++++------------- 4 files changed, 46 insertions(+), 32 deletions(-) diff --git a/Build/source/texk/dvipdfm-x/ChangeLog b/Build/source/texk/dvipdfm-x/ChangeLog index e3958bdd884..601e3f55dcd 100644 --- a/Build/source/texk/dvipdfm-x/ChangeLog +++ b/Build/source/texk/dvipdfm-x/ChangeLog @@ -1,3 +1,9 @@ +2017-09-18 Shunsaku Hirata + + * tt_gsub.c: Fixed a bug that only last specified OTL GSUB + feature was enabled. + * configure.ac: Version 20170918. + 2017-08-25 Akira Kakuto * pdfximage.h, spc_pdfm.c: Remove MAX_IMAGES which is not @@ -7,7 +13,7 @@ * dpxutil.[ch], epdf.c, pdfdoc.[ch], pdfximage.c, xbb.c: Support for /Rotate page attribute in PDF inclusion. - configure.ac: Version 20170806. + * configure.ac: Version 20170806. 2017-06-27 Akira Kakuto diff --git a/Build/source/texk/dvipdfm-x/configure b/Build/source/texk/dvipdfm-x/configure index 939162f2b06..543bc34d7c0 100755 --- a/Build/source/texk/dvipdfm-x/configure +++ b/Build/source/texk/dvipdfm-x/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for dvipdfm-x (TeX Live) 20170806. +# Generated by GNU Autoconf 2.69 for dvipdfm-x (TeX Live) 20170918. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='dvipdfm-x (TeX Live)' PACKAGE_TARNAME='dvipdfm-x--tex-live-' -PACKAGE_VERSION='20170806' -PACKAGE_STRING='dvipdfm-x (TeX Live) 20170806' +PACKAGE_VERSION='20170918' +PACKAGE_STRING='dvipdfm-x (TeX Live) 20170918' PACKAGE_BUGREPORT='tex-k@tug.org' PACKAGE_URL='' @@ -1350,7 +1350,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures dvipdfm-x (TeX Live) 20170806 to adapt to many kinds of systems. +\`configure' configures dvipdfm-x (TeX Live) 20170918 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1421,7 +1421,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of dvipdfm-x (TeX Live) 20170806:";; + short | recursive ) echo "Configuration of dvipdfm-x (TeX Live) 20170918:";; esac cat <<\_ACEOF @@ -1551,7 +1551,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -dvipdfm-x (TeX Live) configure 20170806 +dvipdfm-x (TeX Live) configure 20170918 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2390,7 +2390,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by dvipdfm-x (TeX Live) $as_me 20170806, which was +It was created by dvipdfm-x (TeX Live) $as_me 20170918, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -8075,7 +8075,7 @@ fi # Define the identity of the package. PACKAGE='dvipdfm-x--tex-live-' - VERSION='20170806' + VERSION='20170918' cat >>confdefs.h <<_ACEOF @@ -14744,7 +14744,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -dvipdfm-x (TeX Live) config.lt 20170806 +dvipdfm-x (TeX Live) config.lt 20170918 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -16624,7 +16624,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by dvipdfm-x (TeX Live) $as_me 20170806, which was +This file was extended by dvipdfm-x (TeX Live) $as_me 20170918, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -16694,7 +16694,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -dvipdfm-x (TeX Live) config.status 20170806 +dvipdfm-x (TeX Live) config.status 20170918 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/Build/source/texk/dvipdfm-x/configure.ac b/Build/source/texk/dvipdfm-x/configure.ac index 1cf05b723bc..3871bc589ea 100644 --- a/Build/source/texk/dvipdfm-x/configure.ac +++ b/Build/source/texk/dvipdfm-x/configure.ac @@ -7,7 +7,7 @@ dnl This file is free software; the copyright holder dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl -AC_INIT([dvipdfm-x (TeX Live)], [20170806], [tex-k@tug.org]) +AC_INIT([dvipdfm-x (TeX Live)], [20170918], [tex-k@tug.org]) AC_PREREQ([2.65]) AC_CONFIG_SRCDIR([agl.c]) AC_CONFIG_AUX_DIR([../../build-aux]) diff --git a/Build/source/texk/dvipdfm-x/tt_gsub.c b/Build/source/texk/dvipdfm-x/tt_gsub.c index 4aea35d4a9a..7d27cfee701 100644 --- a/Build/source/texk/dvipdfm-x/tt_gsub.c +++ b/Build/source/texk/dvipdfm-x/tt_gsub.c @@ -1359,17 +1359,16 @@ otl_gsub_add_feat (otl_gsub *gsub_list, return retval; } -static const char * +static int scan_otl_tag (const char *otl_tags, const char *endptr, char *script, char *language, char *feature) { const char *p, *period; ASSERT(script && language && feature); - ASSERT(otl_tags < endptr); - if (!otl_tags) - return NULL; + if (!otl_tags || otl_tags >= endptr) + return -1; memset(script, ' ', 4); script[4] = 0; memset(language, ' ', 4); language[4] = 0; @@ -1384,6 +1383,7 @@ scan_otl_tag (const char *otl_tags, const char *endptr, strncpy(script, p, period - p); } else { WARN("Invalid OTL script tag found: %s", p); + return -1; } p = period + 1; period = strchr(p, '.'); @@ -1393,6 +1393,7 @@ scan_otl_tag (const char *otl_tags, const char *endptr, strncpy(language, p, period - p); } else { WARN("Invalid OTL lanuage tag found: %s", p); + return -1; } p = period + 1; } @@ -1400,13 +1401,17 @@ scan_otl_tag (const char *otl_tags, const char *endptr, strcpy(script, "*"); strcpy(language, "*"); } + /* Finally feature */ - if (p < endptr) { + if (p + 4 <= endptr) { strncpy(feature, p, endptr - p); p = endptr; + } else { + WARN("No valid OTL feature tag specified."); + return -1; } - return p; + return 0; } void @@ -1598,21 +1603,23 @@ otl_gsub_set_chain (otl_gsub *gsub_list, const char *otl_tags) { nextptr = strchr(p, ':'); if (!nextptr) nextptr = endptr; - scan_otl_tag(p, nextptr, script, language, feature); + if (scan_otl_tag(p, nextptr, script, language, feature) >= 0) { idx = gsub_find(gsub_list, script, language, feature); - if (idx >= 0 && idx <= gsub_list->num_gsubs) { - struct gsub_entry *entry; - entry = NEW(1, struct gsub_entry); - if (prev) - prev->next = entry; - entry->index = idx; - prev = entry; + if (idx >= 0 && idx <= gsub_list->num_gsubs) { + struct gsub_entry *entry; + entry = NEW(1, struct gsub_entry); + if (!gsub_list->first) + gsub_list->first = entry; + if (prev) + prev->next = entry; + entry->index = idx; + prev = entry; + } } nextptr++; } if (prev) prev->next = NULL; - gsub_list->first = prev; return 0; } @@ -1633,10 +1640,11 @@ otl_gsub_add_feat_list (otl_gsub *gsub_list, const char *otl_tags, sfnt *sfont) nextptr = strchr(p, ':'); if (!nextptr) nextptr = endptr; - scan_otl_tag(p, nextptr, script, language, feature); - idx = gsub_find(gsub_list, script, language, feature); - if (idx < 0) { - otl_gsub_add_feat(gsub_list, script, language, feature, sfont); + if (scan_otl_tag(p, nextptr, script, language, feature) >= 0) { + idx = gsub_find(gsub_list, script, language, feature); + if (idx < 0) { + otl_gsub_add_feat(gsub_list, script, language, feature, sfont); + } } nextptr++; } -- cgit v1.2.3