diff options
-rw-r--r-- | Build/source/texk/dvipsk/ChangeLog | 7 | ||||
-rw-r--r-- | Build/source/texk/dvipsk/dvips.c | 15 | ||||
-rw-r--r-- | Build/source/texk/dvipsk/resident.c | 2 |
3 files changed, 16 insertions, 8 deletions
diff --git a/Build/source/texk/dvipsk/ChangeLog b/Build/source/texk/dvipsk/ChangeLog index 7ec0655a12c..5167f50475d 100644 --- a/Build/source/texk/dvipsk/ChangeLog +++ b/Build/source/texk/dvipsk/ChangeLog @@ -1,3 +1,10 @@ +2009-05-08 Karl Berry <karl@tug.org> + + * resident.c (getpsinfo): avoid accessing unallocated downbuf[-1]. + * dvips.c (main): do not check iname[-1] if there is no iname. + Reports from Akira. + Also prettify some related error messages. + 2009-04-04 Karl Berry <karl@tug.org> * writet1.c (append_cs_return): new fn. diff --git a/Build/source/texk/dvipsk/dvips.c b/Build/source/texk/dvipsk/dvips.c index 7f1bb9cd08e..8a310219135 100644 --- a/Build/source/texk/dvipsk/dvips.c +++ b/Build/source/texk/dvipsk/dvips.c @@ -1175,7 +1175,8 @@ default: } if (oname[0] == '-' && oname[1] == 0) oname[0] = 0 ; - else if (*oname == 0 && ! filter) { + else if (*oname == 0 && ! filter && *iname) { + /* determine output name from input name */ oname = nextstring ; #ifndef VMCMS /* get stuff before LAST "." */ lastext = strlen(iname) - 1 ; @@ -1281,21 +1282,21 @@ default: SET_BINARY(fileno(stdin)) ; } else { #ifdef KPATHSEA - fprintf (stderr, "Missing DVI file argument (or -f).\n"); - fprintf (stderr, "Try --help for more information.\n"); + fprintf (stderr, "dvips: Missing DVI file argument (or -f).\n"); + fprintf (stderr, "dvips: Try --help for more information.\n"); #else help(1) ; #endif exit(1) ; } - initcolor() ; if (dvifile==NULL) { - extern char errbuf[]; - (void)sprintf(errbuf,"! DVI file <%s> can't be opened.", iname) ; - error("! DVI file can't be opened.") ; + error_with_perror("DVI file can't be opened:", iname); + exit(1); } if (fseek(dvifile, 0L, 0) < 0) error("! DVI file must not be a pipe.") ; + + initcolor() ; #ifdef FONTLIB fliload(); /* read the font libaries */ #endif diff --git a/Build/source/texk/dvipsk/resident.c b/Build/source/texk/dvipsk/resident.c index ec3f7b4d326..9b8be0f8927 100644 --- a/Build/source/texk/dvipsk/resident.c +++ b/Build/source/texk/dvipsk/resident.c @@ -964,7 +964,7 @@ void getpsinfo P1C(char *, name) if (downloadinfo) strcat(downbuf, downloadinfo) ; slen = strlen(downbuf) - 1; - if (downbuf[slen] == ' ') { + if (slen > 0 && downbuf[slen] == ' ') { downbuf[slen] = 0; } if (TeXname) { |