diff options
-rw-r--r-- | Build/source/texk/mendexk/ChangeLog | 4 | ||||
-rw-r--r-- | Build/source/texk/mendexk/convert.c | 9 |
2 files changed, 9 insertions, 4 deletions
diff --git a/Build/source/texk/mendexk/ChangeLog b/Build/source/texk/mendexk/ChangeLog index c1eb16fdd5f..6f1b0506a67 100644 --- a/Build/source/texk/mendexk/ChangeLog +++ b/Build/source/texk/mendexk/ChangeLog @@ -1,3 +1,7 @@ +2014-07-05 TANAKA Takuji <KXD02663@nifty.ne.jp> + + * convert.c: Better timing for xstrdup. + 2014-06-25 Peter Breitenlohner <peb@mppmu.mpg.de> * main.c: Drop definition of TL_VERSION. diff --git a/Build/source/texk/mendexk/convert.c b/Build/source/texk/mendexk/convert.c index ce89c06f7fe..24aeecd7b1f 100644 --- a/Build/source/texk/mendexk/convert.c +++ b/Build/source/texk/mendexk/convert.c @@ -151,21 +151,22 @@ static int dicvalread(const char *filename, struct dictionary *dicval, int line) buff2[k]=buff[j]; } buff2[k]='\0'; - dicval[i].dic[0]=xstrdup(buff2); - if (strlen(dicval[i].dic[0])==0) { + if (strlen(buff2)==0) { i--; continue; } + dicval[i].dic[0]=xstrdup(buff2); for (;((buff[j]==' ')||(buff[j]=='\t'));j++); for (k=0;((buff[j]!='\r')&&(buff[j]!='\n')&&(buff[j]!=' ')&&(buff[j]!='\t'));j++,k++) { buff2[k]=buff[j]; } buff2[k]='\0'; - dicval[i].dic[1]=xstrdup(buff2); - if (strlen(dicval[i].dic[1])==0) { + if (strlen(buff2)==0) { + free(dicval[i].dic[0]); i--; continue; } + dicval[i].dic[1]=xstrdup(buff2); convert(dicval[i].dic[1],buff); strcpy(dicval[i].dic[1],buff); |