From d0b0df2efdc844eb4f396115267cabbc23b7f99a Mon Sep 17 00:00:00 2001 From: Takuji Tanaka Date: Sun, 17 Feb 2019 01:48:55 +0000 Subject: upmendex version 0.52 git-svn-id: svn://tug.org/texlive/trunk@50040 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/upmendex/COPYRIGHT | 2 +- Build/source/texk/upmendex/ChangeLog | 10 +++ Build/source/texk/upmendex/configure | 22 +++---- Build/source/texk/upmendex/configure.ac | 2 +- Build/source/texk/upmendex/convert.c | 18 +++--- Build/source/texk/upmendex/fread.c | 6 +- Build/source/texk/upmendex/fwrite.c | 106 +++++++++++++++++++++----------- Build/source/texk/upmendex/hanzi.h | 10 +-- Build/source/texk/upmendex/kp.c | 4 +- Build/source/texk/upmendex/main.c | 10 ++- Build/source/texk/upmendex/mendex.h | 2 +- Build/source/texk/upmendex/sort.c | 6 +- Build/source/texk/upmendex/styfile.c | 14 ++--- 13 files changed, 129 insertions(+), 83 deletions(-) (limited to 'Build/source/texk/upmendex') diff --git a/Build/source/texk/upmendex/COPYRIGHT b/Build/source/texk/upmendex/COPYRIGHT index 71d21b0a15d..1cc83b01680 100644 --- a/Build/source/texk/upmendex/COPYRIGHT +++ b/Build/source/texk/upmendex/COPYRIGHT @@ -1,5 +1,5 @@ Copyright (C) 1995 ASCII Corporation, 2009 ASCII MEDIA WORKS, - 2015-2017 TANAKA Takuji + 2015-2019 TANAKA Takuji All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/Build/source/texk/upmendex/ChangeLog b/Build/source/texk/upmendex/ChangeLog index 2923c0dc870..51f4af3cc34 100644 --- a/Build/source/texk/upmendex/ChangeLog +++ b/Build/source/texk/upmendex/ChangeLog @@ -1,3 +1,13 @@ +2019-02-17 TANAKA Takuji + + * version 0.52 Beta version. + * main.c, COPYRIGHT: Update copyright year. + * fread.c: Fix typo. It seems a bug. + * {convert,fread,fwrite,kp,sort,styfile}.c, {hanzi,mendex}.h: + Avoid compiler warnings. + Thanks to @ngothan for a report by covscan. + https://github.com/TeX-Live/texlive-source/issues/11 + 2017-04-05 TANAKA Takuji * main.c: Avoid access violation. diff --git a/Build/source/texk/upmendex/configure b/Build/source/texk/upmendex/configure index 3d9785fbaaf..f3c0ab64825 100755 --- a/Build/source/texk/upmendex/configure +++ b/Build/source/texk/upmendex/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for upmendex (TeX Live) 0.50. +# Generated by GNU Autoconf 2.69 for upmendex (TeX Live) 0.52. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -587,8 +587,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='upmendex (TeX Live)' PACKAGE_TARNAME='upmendex--tex-live-' -PACKAGE_VERSION='0.50' -PACKAGE_STRING='upmendex (TeX Live) 0.50' +PACKAGE_VERSION='0.52' +PACKAGE_STRING='upmendex (TeX Live) 0.52' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1344,7 +1344,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 upmendex (TeX Live) 0.50 to adapt to many kinds of systems. +\`configure' configures upmendex (TeX Live) 0.52 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1415,7 +1415,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of upmendex (TeX Live) 0.50:";; + short | recursive ) echo "Configuration of upmendex (TeX Live) 0.52:";; esac cat <<\_ACEOF @@ -1540,7 +1540,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -upmendex (TeX Live) configure 0.50 +upmendex (TeX Live) configure 0.52 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2473,7 +2473,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 upmendex (TeX Live) $as_me 0.50, which was +It was created by upmendex (TeX Live) $as_me 0.52, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -8672,7 +8672,7 @@ fi # Define the identity of the package. PACKAGE='upmendex--tex-live-' - VERSION='0.50' + VERSION='0.52' # Some tools Automake needs. @@ -18201,7 +18201,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -upmendex (TeX Live) config.lt 0.50 +upmendex (TeX Live) config.lt 0.52 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -20274,7 +20274,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 upmendex (TeX Live) $as_me 0.50, which was +This file was extended by upmendex (TeX Live) $as_me 0.52, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -20340,7 +20340,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="\\ -upmendex (TeX Live) config.status 0.50 +upmendex (TeX Live) config.status 0.52 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/Build/source/texk/upmendex/configure.ac b/Build/source/texk/upmendex/configure.ac index 53d37dff059..9a6cbfa555e 100644 --- a/Build/source/texk/upmendex/configure.ac +++ b/Build/source/texk/upmendex/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([upmendex (TeX Live)], [0.50]) +AC_INIT([upmendex (TeX Live)], [0.52]) AC_PREREQ([2.63]) AC_CONFIG_SRCDIR([main.c]) AC_CONFIG_AUX_DIR([../../build-aux]) diff --git a/Build/source/texk/upmendex/convert.c b/Build/source/texk/upmendex/convert.c index 19e1e179772..72e7cb5b783 100644 --- a/Build/source/texk/upmendex/convert.c +++ b/Build/source/texk/upmendex/convert.c @@ -11,6 +11,8 @@ #include "kp.h" +#define BUFFERLEN 4096 + struct dictionary{ UChar* dic[2]; }; @@ -52,7 +54,7 @@ int dicread(const char *filename) { int i,ecount=0; const char *envfile; - char buff[4096]; + char buff[BUFFERLEN]; FILE *fp; if (filename!=NULL) { @@ -68,7 +70,7 @@ int dicread(const char *filename) verb_printf(efp,"Scanning dictionary file %s.",filename); for (i=0;;i++) { - if (fgets(buff,4095,fp)==NULL) break; + if (fgets(buff,BUFFERLEN-1,fp)==NULL) break; if ((buff[0]=='\r')||(buff[0]=='\n')||(buff[0]=='\0')) i--; } fclose(fp); @@ -185,7 +187,7 @@ static int dcomp(const void *bf1, const void *bf2) int convert(UChar *buff1, UChar *buff2) { int i=0,j=0,k; - char errbuff[4096],errbuff2[4096]; + char errbuff[BUFFERLEN],errbuff2[BUFFERLEN]; int wclen; UChar buff3[3]; @@ -196,9 +198,9 @@ int convert(UChar *buff1, UChar *buff2) } else { wclen = is_surrogate_pair(&buff1[i]) ? 2 : 1; - buff3[0] =buff1[i]; - if (wclen==2) buff3[1] =buff1[i+1]; - buff3[wclen]=L'\0'; + buff3[0] =buff1[i]; + if (wclen==2){ buff3[1] =buff1[i+1]; } + buff3[wclen]=L'\0'; if ( lorder==1 &&( buff1[i]==' ' || buff1[i]=='\t' || buff3[0]==0x00A0 || buff3[0]==0x202F || buff3[0]==0x2060 || buff3[0]==0xFEFF )) { @@ -267,8 +269,8 @@ int convert(UChar *buff1, UChar *buff2) j+=wclen; } else { - widechar_to_multibyte(errbuff2,4096,&buff1[i]); - sprintf(errbuff,"\nError: %s is no entry in dictionary file ",errbuff2); + widechar_to_multibyte(errbuff2,BUFFERLEN,&buff1[i]); + snprintf(errbuff,BUFFERLEN,"\nError: %s is no entry in dictionary file ",errbuff2); fputs(errbuff,efp); if (efp!=stderr) fputs(errbuff,stderr); return -1; diff --git a/Build/source/texk/upmendex/fread.c b/Build/source/texk/upmendex/fread.c index 75c1e01470b..358c21a4987 100644 --- a/Build/source/texk/upmendex/fread.c +++ b/Build/source/texk/upmendex/fread.c @@ -51,7 +51,7 @@ int idxread(char *filename, int start) for (i=start,n=1;;i++,n++) { if (!(i%100)) - ind=(struct index *)realloc(ind,sizeof(struct index)*(i+100)); + ind=(struct index *)xrealloc(ind,sizeof(struct index)*(i+100)); LOOP: ind[i].lnum=n; if (fgets(buff,sizeof(buff)-1,fp)==NULL) break; @@ -293,7 +293,7 @@ LOOP: else tmp1=ind[i].idx[m]; if (ind[l].org[m]!=NULL) tmp2=ind[l].org[m]; - else tmp2=ind[i].idx[m]; + else tmp2=ind[l].idx[m]; widechar_to_multibyte(wbuff,BUFSIZE,tmp1); verb_printf(efp,"\nWarning: Sort key \"%s\"",wbuff); @@ -354,7 +354,7 @@ LOOP: if (k>ind[l].num) { ind[l].num++; - if (!((ind[l].num)%16)) ind[l].p=(struct page *)realloc(ind[l].p,sizeof(struct page)*((int)((ind[l].num)/16)+1)*16); + if (!((ind[l].num)%16)) ind[l].p=(struct page *)xrealloc(ind[l].p,sizeof(struct page)*((int)((ind[l].num)/16)+1)*16); ind[l].p[ind[l].num].page=xstrdup(table); diff --git a/Build/source/texk/upmendex/fwrite.c b/Build/source/texk/upmendex/fwrite.c index a54b5dd0d1e..6736f56e5a2 100644 --- a/Build/source/texk/upmendex/fwrite.c +++ b/Build/source/texk/upmendex/fwrite.c @@ -254,15 +254,18 @@ void indwrite(char *filename, struct index *ind, int pagenum) case 2: widechar_to_multibyte(obuff,BUFFERLEN,ind[i].idx[1]); - SAPPENDF(lbuff,"%s%s",item_x1,obuff); + SAPPENDF(lbuff,"%s",item_x1); + SAPPENDF(lbuff,"%s",obuff); SAPPENDF(lbuff,"%s",delim_1); break; case 3: widechar_to_multibyte(obuff,BUFFERLEN,ind[i].idx[1]); - SAPPENDF(lbuff,"%s%s",item_x1,obuff); + SAPPENDF(lbuff,"%s",item_x1); + SAPPENDF(lbuff,"%s",obuff); widechar_to_multibyte(obuff,BUFFERLEN,ind[i].idx[2]); - SAPPENDF(lbuff,"%s%s",item_x2,obuff); + SAPPENDF(lbuff,"%s",item_x2); + SAPPENDF(lbuff,"%s",obuff); SAPPENDF(lbuff,"%s",delim_2); break; @@ -335,13 +338,17 @@ void indwrite(char *filename, struct index *ind, int pagenum) switch (ind[i].words) { case 1: widechar_to_multibyte(obuff,BUFFERLEN,ind[i].idx[0]); - SAPPENDF(lbuff,"%s%s%s",item_0,obuff,delim_0); + SAPPENDF(lbuff,"%s",item_0); + SAPPENDF(lbuff,"%s",obuff); + SAPPENDF(lbuff,"%s",delim_0); break; case 2: if (u_strcmp(ind[i-1].idx[0],ind[i].idx[0])!=0 || u_strcmp(ind[i-1].dic[0],ind[i].dic[0])!=0) { widechar_to_multibyte(obuff,BUFFERLEN,ind[i].idx[0]); - SAPPENDF(lbuff,"%s%s%s",item_0,obuff,item_x1); + SAPPENDF(lbuff,"%s",item_0); + SAPPENDF(lbuff,"%s",obuff); + SAPPENDF(lbuff,"%s",item_x1); } else { if (ind[i-1].words==1) { @@ -359,24 +366,32 @@ void indwrite(char *filename, struct index *ind, int pagenum) case 3: if (u_strcmp(ind[i-1].idx[0],ind[i].idx[0])!=0 || u_strcmp(ind[i-1].dic[0],ind[i].dic[0])!=0) { widechar_to_multibyte(obuff,BUFFERLEN,ind[i].idx[0]); - SAPPENDF(lbuff,"%s%s",item_0,obuff); + SAPPENDF(lbuff,"%s",item_0); + SAPPENDF(lbuff,"%s",obuff); widechar_to_multibyte(obuff,BUFFERLEN,ind[i].idx[1]); - SAPPENDF(lbuff,"%s%s%s",item_x1,obuff,item_x2); + SAPPENDF(lbuff,"%s",item_x1); + SAPPENDF(lbuff,"%s",obuff); + SAPPENDF(lbuff,"%s",item_x2); } else if (ind[i-1].words==1) { widechar_to_multibyte(obuff,BUFFERLEN,ind[i].idx[1]); - SAPPENDF(lbuff,"%s%s%s",item_01,obuff,item_x2); + SAPPENDF(lbuff,"%s",item_01); + SAPPENDF(lbuff,"%s",obuff); + SAPPENDF(lbuff,"%s",item_x2); } else if (u_strcmp(ind[i-1].idx[1],ind[i].idx[1])!=0 || u_strcmp(ind[i-1].dic[1],ind[i].dic[1])!=0) { widechar_to_multibyte(obuff,BUFFERLEN,ind[i].idx[1]); - if (ind[i-1].words==2) SAPPENDF(lbuff,"%s%s%s",item_1,obuff,item_12); - else SAPPENDF(lbuff,"%s%s%s",item_1,obuff,item_x2); + SAPPENDF(lbuff,"%s",item_1); + SAPPENDF(lbuff,"%s",obuff); + if (ind[i-1].words==2) SAPPENDF(lbuff,"%s",item_12); + else SAPPENDF(lbuff,"%s",item_x2); } else { SAPPENDF(lbuff,"%s",item_2); } widechar_to_multibyte(obuff,BUFFERLEN,ind[i].idx[2]); - SAPPENDF(lbuff,"%s%s",obuff,delim_2); + SAPPENDF(lbuff,"%s",obuff); + SAPPENDF(lbuff,"%s",delim_2); break; default: @@ -416,16 +431,20 @@ static void printpage(struct index *ind, FILE *fp, int num, char *lbuff) SPRINTF(buff,"%s%s%s",encap_prefix,ind[num].p[j].enc,encap_infix); } if (strlen(suffix_3p)>0 && (pnumconv(ind[num].p[cc].page,ind[num].p[cc].attr[0])-pnumconv(ind[num].p[j].page,ind[num].p[j].attr[0]))==2) { - SAPPENDF(buff,"%s%s",ind[num].p[j].page,suffix_3p); + SAPPENDF(buff,"%s",ind[num].p[j].page); + SAPPENDF(buff,"%s",suffix_3p); } else if (strlen(suffix_mp)>0 && (pnumconv(ind[num].p[cc].page,ind[num].p[cc].attr[0])-pnumconv(ind[num].p[j].page,ind[num].p[j].attr[0]))>=2) { - SAPPENDF(buff,"%s%s",ind[num].p[j].page,suffix_mp); + SAPPENDF(buff,"%s",ind[num].p[j].page); + SAPPENDF(buff,"%s",suffix_mp); } else if (strlen(suffix_2p)>0 && (pnumconv(ind[num].p[cc].page,ind[num].p[cc].attr[0])-pnumconv(ind[num].p[j].page,ind[num].p[j].attr[0]))==1) { - SAPPENDF(buff,"%s%s",ind[num].p[j].page,suffix_2p); + SAPPENDF(buff,"%s",ind[num].p[j].page); + SAPPENDF(buff,"%s",suffix_2p); } else { - SAPPENDF(buff,"%s%s",ind[num].p[j].page,delim_r); + SAPPENDF(buff,"%s",ind[num].p[j].page); + SAPPENDF(buff,"%s",delim_r); SAPPENDF(buff,"%s",ind[num].p[cc].page); } SAPPENDF(tmpbuff,"%s",buff); @@ -449,24 +468,31 @@ static void printpage(struct index *ind, FILE *fp, int num, char *lbuff) SPRINTF(errbuff,"Warning: Unmatched range closing operator \'%c\',",range_close); for (i=0;i0) { - SAPPENDF(tmpbuff,"%s%s%s",encap_prefix,ind[num].p[j].enc,encap_infix); - SAPPENDF(tmpbuff,"%s%s%s",ind[num].p[j].page,encap_suffix,delim_n); + SAPPENDF(tmpbuff,"%s",encap_prefix); + SAPPENDF(tmpbuff,"%s",ind[num].p[j].enc); + SAPPENDF(tmpbuff,"%s",encap_infix); + SAPPENDF(tmpbuff,"%s",ind[num].p[j].page); + SAPPENDF(tmpbuff,"%s",encap_suffix); + SAPPENDF(tmpbuff,"%s",delim_n); linecheck(lbuff,tmpbuff); } else { - SAPPENDF(tmpbuff,"%s%s",ind[num].p[j].page,delim_n); + SAPPENDF(tmpbuff,"%s",ind[num].p[j].page); + SAPPENDF(tmpbuff,"%s",delim_n); linecheck(lbuff,tmpbuff); } } else { /* no encap */ - SAPPENDF(tmpbuff,"%s%s",ind[num].p[j].page,delim_n); + SAPPENDF(tmpbuff,"%s",ind[num].p[j].page); + SAPPENDF(tmpbuff,"%s",delim_n); linecheck(lbuff,tmpbuff); } } @@ -475,7 +501,8 @@ static void printpage(struct index *ind, FILE *fp, int num, char *lbuff) SPRINTF(errbuff,"Warning: Unmatched range opening operator \'%c\',",range_open); for (k=0;k0) { - SAPPENDF(tmpbuff,"%s%s%s",encap_prefix,ind[num].p[j].enc,encap_infix); - SAPPENDF(tmpbuff,"%s%s",ind[num].p[j].page,encap_suffix); + SAPPENDF(tmpbuff,"%s",encap_prefix); + SAPPENDF(tmpbuff,"%s",ind[num].p[j].enc); + SAPPENDF(tmpbuff,"%s",encap_infix); + SAPPENDF(tmpbuff,"%s",ind[num].p[j].page); + SAPPENDF(tmpbuff,"%s",encap_suffix); } else { SAPPENDF(tmpbuff,"%s",ind[num].p[j].page); @@ -513,7 +544,8 @@ static int range_check(struct index ind, int count, char *lbuff) if (ind.p[i].enc[0]==range_close) { SPRINTF(errbuff,"Warning: Unmatched range closing operator \'%c\',",range_close); widechar_to_multibyte(obuff,BUFFERLEN,ind.idx[0]); - SAPPENDF(errbuff,"%s.",obuff); + SAPPENDF(errbuff,"%s",obuff); + SAPPENDF(errbuff,"."); warn_printf(efp, "%s\n", errbuff); ind.p[i].enc++; } @@ -532,14 +564,15 @@ static int range_check(struct index ind, int count, char *lbuff) SPRINTF(errbuff,"Warning: Unmatched range opening operator \'%c\',",range_open); for (k=0;k0) { - SPRINTF(tmpbuff,"%s%s%s",encap_prefix,ind.p[j].enc,encap_infix); - SAPPENDF(tmpbuff,"%s%s%s",ind.p[j].page,encap_suffix,delim_n); + SPRINTF(tmpbuff,"%s%s%s%s%s%s",encap_prefix,ind.p[j].enc,encap_infix + ,ind.p[j].page,encap_suffix,delim_n); linecheck(lbuff,tmpbuff); } } @@ -548,7 +581,8 @@ static int range_check(struct index ind, int count, char *lbuff) SPRINTF(errbuff,"Warning: Unmatched range opening operator \'%c\',",range_open); for (k=0;kline_max) { - SAPPENDF(lbuff,"\n%s%s",indent_space,tmpbuff); + SAPPENDF(lbuff,"\n"); + SAPPENDF(lbuff,"%s",indent_space); + SAPPENDF(lbuff,"%s",tmpbuff); line_length=indent_length+strlen(tmpbuff); tmpbuff[0]='\0'; } @@ -602,7 +638,7 @@ static void crcheck(char *lbuff, FILE *fp) strncpy(buff,lbuff,i+1); buff[i+1]='\0'; fputs(buff,fp); - strcpy(buff,&lbuff[i+1]); + strncpy(buff,&lbuff[i+1],BUFFERLEN-1); strcpy(lbuff,buff); break; } @@ -698,15 +734,15 @@ static void index_normalize(UChar *istr, UChar *ini, int *chset) ini[0]=ch; return; } - else if (len=is_hanzi(istr)) { + else if ((len=is_hanzi(istr))>0) { if (hanzi_mode==0) hanzi_mode=init_hanzi_header(); if (hanzi_mode==HANZI_UNKNOWN) { u_strcpy(ini, hz_index[0].idx); return; } - strX[0] =istr[0]; - if (len==2) strX[1] =istr[1]; - strX[len]=L'\0'; + strX[0] =istr[0]; + if (len==2){ strX[1] =istr[1]; } + strX[len]=L'\0'; lo=0; hi=hz_index_len; while (lo=0x80 || src[i+1]=='\0')) { - strncpy(tmp,&src[j],i-j+1); + strncpy(tmp,(char *)&src[j],i-j+1); tmp[i-j+1]='\0'; k=u_strlen(dist); u_unescape(tmp, &dist[k], STYBUFSIZE-k); j=i+1; } else if (src[i]>=0x80 && (src[i+1]< 0x80 || src[i+1]=='\0')) { - strncpy(tmp,&src[j],i-j+1); + strncpy(tmp,(char *)&src[j],i-j+1); tmp[i-j+1]='\0'; k=u_strlen(dist); multibyte_to_widechar(&dist[k], STYBUFSIZE-k, tmp); diff --git a/Build/source/texk/upmendex/styfile.c b/Build/source/texk/upmendex/styfile.c index 25e100fb6df..1c94c900770 100644 --- a/Build/source/texk/upmendex/styfile.c +++ b/Build/source/texk/upmendex/styfile.c @@ -293,20 +293,20 @@ static int sstrncmp(const char *s1, const char *s2, size_t len) return strncmp(s1, s2, len); } -void set_icu_attributes() +void set_icu_attributes(void) { int i,attr; char *pos, *tmp; for (i=0;i0) { pos+=10; attr=UCOL_ALTERNATE_HANDLING; if (strstr(pos,"shifted")) icu_attributes[attr]=UCOL_SHIFTED; else if (strstr(pos,"non-ignorable")) icu_attributes[attr]=UCOL_NON_IGNORABLE; else verb_printf(efp,"\nWarning: Illegal input for icu_attributes (alternate)."); } - if (pos=strstr(tmp,"strength:")) { + if ((pos=strstr(tmp,"strength:"))>0) { pos+=9; attr=UCOL_STRENGTH; if (strstr(pos,"primary")) icu_attributes[attr]=UCOL_PRIMARY; else if (strstr(pos,"secondary")) icu_attributes[attr]=UCOL_SECONDARY; @@ -315,26 +315,26 @@ void set_icu_attributes() else if (strstr(pos,"identical")) icu_attributes[attr]=UCOL_IDENTICAL; else verb_printf(efp,"\nWarning: Illegal input for icu_attributes (strength)."); } - if (pos=strstr(tmp,"french-collation:")) { + if ((pos=strstr(tmp,"french-collation:"))>0) { pos+=17; attr=UCOL_FRENCH_COLLATION; if (strstr(pos,"on")) icu_attributes[attr]=UCOL_ON; else if (strstr(pos,"off")) icu_attributes[attr]=UCOL_OFF; else verb_printf(efp,"\nWarning: Illegal input for icu_attributes (french-collation)."); } - if (pos=strstr(tmp,"case-first:")) { + if ((pos=strstr(tmp,"case-first:"))>0) { pos+=11; attr=UCOL_CASE_FIRST; if (strstr(pos,"off")) icu_attributes[attr]=UCOL_OFF; else if (strstr(pos,"upper-first")) icu_attributes[attr]=UCOL_UPPER_FIRST; else if (strstr(pos,"lower-first")) icu_attributes[attr]=UCOL_LOWER_FIRST; else verb_printf(efp,"\nWarning: Illegal input for icu_attributes (case-first)."); } - if (pos=strstr(tmp,"case-level:")) { + if ((pos=strstr(tmp,"case-level:"))>0) { pos+=11; attr=UCOL_CASE_LEVEL; if (strstr(pos,"on")) icu_attributes[attr]=UCOL_ON; else if (strstr(pos,"off")) icu_attributes[attr]=UCOL_OFF; else verb_printf(efp,"\nWarning: Illegal input for icu_attributes (case-level)."); } - if (pos=strstr(tmp,"normalization-mode:")) { + if ((pos=strstr(tmp,"normalization-mode:"))>0) { pos+=19; attr=UCOL_NORMALIZATION_MODE; if (strstr(pos,"on")) icu_attributes[attr]=UCOL_ON; else if (strstr(pos,"off")) icu_attributes[attr]=UCOL_OFF; -- cgit v1.2.3