summaryrefslogtreecommitdiff
path: root/Build/source/texk/mendexk/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/mendexk/main.c')
-rw-r--r--Build/source/texk/mendexk/main.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/Build/source/texk/mendexk/main.c b/Build/source/texk/mendexk/main.c
index 697c4954c72..28f9ae97d36 100644
--- a/Build/source/texk/mendexk/main.c
+++ b/Build/source/texk/mendexk/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;
char *p;
@@ -60,7 +60,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':
@@ -141,12 +141,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':
@@ -228,10 +233,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);
}
}
@@ -265,8 +270,6 @@ int main(int argc, char **argv)
logfile=xstrdup("stderr");
}
- if (styfile!=NULL) styread(styfile);
-
if (strcmp(argv[0],"makeindex")==0) {
verb_printf(efp,"This is Not `MAKEINDEX\', But `MENDEX\' %s (%s) (%s).\n",
VERSION, get_enc_string(), TL_VERSION);
@@ -280,6 +283,10 @@ int main(int argc, char **argv)
initkanatable();
+ for (k=0;styfile[k]!=NULL;k++) {
+ styread(styfile[k]);
+ }
+
/* read dictionary */
ecount+=dicread(dicfile);