diff options
Diffstat (limited to 'Build/source/texk/upmendex/main.c')
-rw-r--r-- | Build/source/texk/upmendex/main.c | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/Build/source/texk/upmendex/main.c b/Build/source/texk/upmendex/main.c index 884c64c15ff..f96ae8ff544 100644 --- a/Build/source/texk/upmendex/main.c +++ b/Build/source/texk/upmendex/main.c @@ -9,7 +9,7 @@ #include "kp.h" -char *styfile,*idxfile[256],*indfile,*dicfile,*logfile; +char *styfile[64],*idxfile[256],*indfile,*dicfile,*logfile; /* default paths */ #ifndef DEFAULT_INDEXSTYLES @@ -22,7 +22,7 @@ KpathseaSupportInfo kp_ist,kp_dict; int main(int argc, char **argv) { - int i,j,cc=0,startpagenum=-1,ecount=0,chkopt=1; + int i,j,k,cc=0,startpagenum=-1,ecount=0,chkopt=1; const char *envbuff; UVersionInfo icuVersion; char icu_version[U_MAX_VERSION_STRING_LENGTH] = ""; @@ -54,7 +54,7 @@ int main(int argc, char **argv) /* check options */ - for (i=1,j=0;i<argc && j<256;i++) { + for (i=1,j=k=0;i<argc && j<256;i++) { if ((argv[i][0]=='-')&&(strlen(argv[i])>=2)&&chkopt) { switch (argv[i][1]) { case 'c': @@ -135,12 +135,17 @@ int main(int argc, char **argv) break; case 's': + if (k==64) { + fprintf (stderr, "Too many style files.\n"); + exit(255); + } if ((argv[i][2]=='\0')&&(i+1<argc)) { - styfile=xstrdup(argv[++i]); + styfile[k]=xstrdup(argv[++i]); } else { - styfile=xstrdup(&argv[i][2]); + styfile[k]=xstrdup(&argv[i][2]); } + k++; break; case 'v': @@ -190,10 +195,10 @@ int main(int argc, char **argv) if (idxcount==0) idxcount=fsti=1; - if (styfile==NULL) { + if (styfile[0]==NULL) { envbuff=kpse_var_value("INDEXDEFAULTSTYLE"); if (envbuff!=NULL) { - styfile=xstrdup(envbuff); + styfile[0]=xstrdup(envbuff); } } @@ -227,12 +232,6 @@ int main(int argc, char **argv) logfile=xstrdup("stderr"); } -/* init hangul tumunja table */ - u_strcpy(tumunja,GANADA); - if (styfile!=NULL) styread(styfile); - - set_icu_attributes(); - if (strcmp(argv[0],"makeindex")==0) { verb_printf(efp,"This is Not `MAKEINDEX\', But `UPMENDEX\' %s (%s).\n", VERSION, TL_VERSION); @@ -246,6 +245,15 @@ int main(int argc, char **argv) initkanatable(); +/* init hangul tumunja table */ + u_strcpy(tumunja,GANADA); + + for (k=0;styfile[k]!=NULL;k++) { + styread(styfile[k]); + } + + set_icu_attributes(); + /* read dictionary */ ecount+=dicread(dicfile); @@ -273,6 +281,7 @@ int main(int argc, char **argv) default: break; } + if (u_strlen(kana_head)>0) u_strcpy(atama,kana_head); /* read idx file */ |