diff options
Diffstat (limited to 'Build/source/texk/dvipsk/dvips.c')
-rw-r--r-- | Build/source/texk/dvipsk/dvips.c | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/Build/source/texk/dvipsk/dvips.c b/Build/source/texk/dvipsk/dvips.c index 9f78ccbced7..c01681b9709 100644 --- a/Build/source/texk/dvipsk/dvips.c +++ b/Build/source/texk/dvipsk/dvips.c @@ -1,10 +1,6 @@ /* * This is the main routine. */ -#ifndef DEFRES -#define DEFRES (600) -#endif - #include "dvips.h" /* The copyright notice there is included too! */ #ifdef KPATHSEA #include <kpathsea/c-pathch.h> @@ -44,13 +40,22 @@ extern char *strtok() ; /* some systems don't have this in strings.h */ #include descrip #endif #endif + +#ifndef DEFRES +#define DEFRES (600) +#endif + /* * First we define some globals. */ #ifdef VMS static char ofnme[252],infnme[252],pap[40],thh[20]; #endif -char *downloadedpsname[DOWNLOADEDPSSIZE]; /* PS names fully downloaded as headers */ + +/* PS fonts fully downloaded as headers */ +char *downloadedpsnames[DOWNLOADEDPSSIZE]; + +int unused_top_of_psnames ; /* unused top number of downloadedpsnames[#] */ fontdesctype *fonthead ; /* list of all fonts mentioned so far */ fontdesctype *curfnt ; /* the currently selected font */ sectiontype *sections ; /* sections to process document in */ @@ -308,6 +313,16 @@ help P1C(int, status) fputs (kpse_bug_address, f); #endif } + +void +freememforpsnames(void) +{ + int i; + + for (i = 0; i < unused_top_of_psnames && downloadedpsnames[i]; i++) + free (downloadedpsnames[i]); +} + /* * This error routine prints an error message; if the first * character is !, it aborts the job. @@ -330,6 +345,7 @@ error_with_perror P2C(char *, s, char *, fname) } if (*s=='!') { + freememforpsnames() ; if (bitfile != NULL) { cleanprinter() ; } @@ -442,6 +458,8 @@ initialize P1H(void) i = 10; for (s="abcdef"; *s!=0; s++) xdig[(int)*s] = i++; + for(i=0 ; i < DOWNLOADEDPSSIZE; i++) + downloadedpsnames[i] = NULL; morestrings() ; maxpages = 100000 ; numcopies = 1 ; @@ -554,10 +572,8 @@ main P2C(int, argc, char **, argv) #ifdef MVSXA int firstext = -1 ; #endif - register sectiontype *sects ; + sectiontype *sects ; - for(i=0 ; i < DOWNLOADEDPSSIZE; i++) - downloadedpsname[i] = NULL; #ifdef KPATHSEA kpse_set_program_name (argv[0], "dvips"); kpse_set_program_enabled (kpse_pk_format, MAKE_TEX_PK_BY_DEFAULT, kpse_src_compile); @@ -619,7 +635,7 @@ under the terms of the GNU General Public License\n\ and the Dvips copyright.\n\ For more information about these matters, see the files\n\ named COPYING and dvips.h.\n\ -Primary author of Dvips: T. Rokicki; -k maintainer: T. Kacvinsky/ S. Rahtz."); +Primary author of Dvips: T. Rokicki."); exit (0); } if (argc == 2 && strncmp(argv[1], "-?", 2) == 0) { @@ -1391,6 +1407,7 @@ default: } } } + freememforpsnames() ; if (! sepfiles) { #ifdef HPS if (HPS_FLAG) |