diff options
author | Takuji Tanaka <ttk@t-lab.opal.ne.jp> | 2020-04-30 23:59:13 +0000 |
---|---|---|
committer | Takuji Tanaka <ttk@t-lab.opal.ne.jp> | 2020-04-30 23:59:13 +0000 |
commit | 668a5f651193f17277d25acefd1b9853c621f096 (patch) | |
tree | 390959cdf41a805f697376c8a3f19ebe83b341cc | |
parent | e1e89bb5c96ecfb25ea508abc2f260b416f88cd5 (diff) |
upmendex: Add bug report addresses on command line help
git-svn-id: svn://tug.org/texlive/trunk@54953 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Build/source/texk/upmendex/ChangeLog | 6 | ||||
-rw-r--r-- | Build/source/texk/upmendex/Makefile.am | 1 | ||||
-rw-r--r-- | Build/source/texk/upmendex/Makefile.in | 1 | ||||
-rw-r--r-- | Build/source/texk/upmendex/convert.c | 23 | ||||
-rw-r--r-- | Build/source/texk/upmendex/main.c | 4 | ||||
-rw-r--r-- | Build/source/texk/upmendex/version.h | 2 |
6 files changed, 25 insertions, 12 deletions
diff --git a/Build/source/texk/upmendex/ChangeLog b/Build/source/texk/upmendex/ChangeLog index 6c0e2aaef79..e2dc810d827 100644 --- a/Build/source/texk/upmendex/ChangeLog +++ b/Build/source/texk/upmendex/ChangeLog @@ -1,3 +1,9 @@ +2020-05-01 TANAKA Takuji <ttk@t-lab.opal.ne.jp> + + * main.c, version.h, Makefile.{am.in}: Add bug report addresses + on command line help. + * convert.c: Tune buffer sizes to avoid tool warnings. + 2020-02-22 TANAKA Takuji <ttk@t-lab.opal.ne.jp> * version 0.54 Beta version. diff --git a/Build/source/texk/upmendex/Makefile.am b/Build/source/texk/upmendex/Makefile.am index fc188887f4c..8f1aa54f996 100644 --- a/Build/source/texk/upmendex/Makefile.am +++ b/Build/source/texk/upmendex/Makefile.am @@ -22,6 +22,7 @@ upmendex_SOURCES = \ ktable.h \ main.c \ mendex.h \ + version.h \ pageread.c \ qsort.c \ qsort.h \ diff --git a/Build/source/texk/upmendex/Makefile.in b/Build/source/texk/upmendex/Makefile.in index feb3e6fdf05..bb0abdf29c4 100644 --- a/Build/source/texk/upmendex/Makefile.in +++ b/Build/source/texk/upmendex/Makefile.in @@ -593,6 +593,7 @@ upmendex_SOURCES = \ ktable.h \ main.c \ mendex.h \ + version.h \ pageread.c \ qsort.c \ qsort.h \ diff --git a/Build/source/texk/upmendex/convert.c b/Build/source/texk/upmendex/convert.c index d02b05bf4d4..4687fd4f25a 100644 --- a/Build/source/texk/upmendex/convert.c +++ b/Build/source/texk/upmendex/convert.c @@ -12,6 +12,9 @@ #include "kp.h" #define BUFFERLEN 4096 +#define BUFFERLEN1 256 +#define BUFFERLEN2 (BUFFERLEN1*3) +#define BUFFERLEN3 (BUFFERLEN2+50) struct dictionary{ UChar* dic[2]; @@ -118,8 +121,8 @@ static int dcomp(const void *bf1, const void *bf2); static int dicvalread(const char *filename, struct dictionary *dicval, int line) { int i,j,k; - char buff[256],buff2[256]; - UChar ubuff[256],ubuff2[256]; + char buff[BUFFERLEN1],buff2[BUFFERLEN1]; + UChar ubuff[BUFFERLEN1],ubuff2[BUFFERLEN1]; FILE *fp; if(kpse_in_name_ok(filename)) @@ -143,7 +146,7 @@ static int dicvalread(const char *filename, struct dictionary *dicval, int line) i--; continue; } - multibyte_to_widechar(ubuff,256,buff2); + multibyte_to_widechar(ubuff,BUFFERLEN1,buff2); dicval[i].dic[0]=u_xstrdup(ubuff); for (;((buff[j]==' ')||(buff[j]=='\t'));j++); for (k=0;((buff[j]!='\r')&&(buff[j]!='\n')&&(buff[j]!=' ')&&(buff[j]!='\t'));j++,k++) { @@ -155,7 +158,7 @@ static int dicvalread(const char *filename, struct dictionary *dicval, int line) i--; continue; } - multibyte_to_widechar(ubuff,256,buff2); + multibyte_to_widechar(ubuff,BUFFERLEN1,buff2); convert(ubuff,ubuff2); dicval[i].dic[1]=u_xstrdup(ubuff2); } @@ -173,7 +176,7 @@ static int dcomp(const void *bf1, const void *bf2) const struct dictionary *buff2 = (const struct dictionary *) bf2; int i; - for (i=0;i<256;i++) { + for (i=0;i<BUFFERLEN1;i++) { if (((*buff1).dic[0][i]==L'\0')&&((*buff2).dic[0][i]==L'\0')) return 0; else if (((*buff1).dic[0][i]==L'\0')&&((*buff2).dic[0][i]!=L'\0')) return 1; else if (((*buff1).dic[0][i]!=L'\0')&&((*buff2).dic[0][i]==L'\0')) return -1; @@ -187,7 +190,7 @@ static int dcomp(const void *bf1, const void *bf2) int convert(UChar *buff1, UChar *buff2) { int i=0,j=0,k; - char errbuff[BUFFERLEN],errbuff2[BUFFERLEN]; + char errbuff[BUFFERLEN2],errbuff2[BUFFERLEN3]; int wclen; UChar buff3[3]; @@ -270,10 +273,10 @@ int convert(UChar *buff1, UChar *buff2) j+=wclen; } else { - 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); + widechar_to_multibyte(errbuff,BUFFERLEN2,&buff1[i]); + snprintf(errbuff2,BUFFERLEN3,"\nError: %s is no entry in dictionary file ",errbuff); + fputs(errbuff2,efp); + if (efp!=stderr) fputs(errbuff2,stderr); return -1; } } diff --git a/Build/source/texk/upmendex/main.c b/Build/source/texk/upmendex/main.c index c7d8106b537..a1e9f4789e0 100644 --- a/Build/source/texk/upmendex/main.c +++ b/Build/source/texk/upmendex/main.c @@ -1,4 +1,5 @@ #include "mendex.h" +#include "version.h" #include <kpathsea/tex-file.h> #include <kpathsea/variable.h> @@ -19,8 +20,6 @@ char *styfile,*idxfile[256],*indfile,*dicfile,*logfile; #endif KpathseaSupportInfo kp_ist,kp_dict; -#define VERSION "version 0.54" - int main(int argc, char **argv) { int i,j,cc=0,startpagenum=-1,ecount=0,chkopt=1; @@ -174,6 +173,7 @@ int main(int argc, char **argv) fprintf(stderr,"-t log take log as the error log file.\n"); fprintf(stderr,"-p no set the starting page number of index.\n"); fprintf(stderr,"idx... input files.\n"); + fprintf(stderr,"\nEmail bug reports to %s.\n", BUG_ADDRESS); exit(0); break; } diff --git a/Build/source/texk/upmendex/version.h b/Build/source/texk/upmendex/version.h new file mode 100644 index 00000000000..8cd1c6cd861 --- /dev/null +++ b/Build/source/texk/upmendex/version.h @@ -0,0 +1,2 @@ +#define VERSION "version " PACKAGE_VERSION +#define BUG_ADDRESS "issue@texjp.org, tex-k@tug.org" |