diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2009-11-10 10:32:41 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2009-11-10 10:32:41 +0000 |
commit | 558303c70cdfd3bc2465cb99c2f8d81a64efcf31 (patch) | |
tree | b308833d445fde6a5ad48558fe4eff1b86ab7ff7 /Build/source/texk/bibtex8/utils.c | |
parent | 81f0eba86eca049a6da0619b12d767e51aea3efb (diff) |
towards TL2010: texk/ misc
git-svn-id: svn://tug.org/texlive/trunk@15976 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/bibtex8/utils.c')
-rw-r--r-- | Build/source/texk/bibtex8/utils.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/Build/source/texk/bibtex8/utils.c b/Build/source/texk/bibtex8/utils.c index dc9b801aaac..f5df8eb556f 100644 --- a/Build/source/texk/bibtex8/utils.c +++ b/Build/source/texk/bibtex8/utils.c @@ -191,7 +191,7 @@ static struct option long_options[] = { {0, 0, 0, 0} }; -static char *getopt_str = "78c:d:?stvBHM:W"; +static const char *getopt_str = "78c:d:?stvBHM:W"; @@ -448,10 +448,10 @@ void close_file (const AlphaFile_T file_pointer) ** appropriate debugging option has been selected. **============================================================================ */ -void debug_msg (const int status, char *printf_fmt, ...) +void debug_msg (const int status, const char *printf_fmt, ...) { va_list printf_args; - char *prefix; + const char *prefix; switch (status) { case DBG_CSF: @@ -733,6 +733,8 @@ FILE *open_ip_file (Integer_T search_path) debug_msg (DBG_IO, "open_ip_file: trying to open `%s' ... ", full_filespec); #ifdef KPATHSEA + if (!kpse_in_name_ok(full_filespec)) + goto not_ok; fptr = fopen (full_filespec, FOPEN_R_MODE); free (full_filespec); #else @@ -750,6 +752,7 @@ FILE *open_ip_file (Integer_T search_path) ** Otherwise, return a NULL pointer. */ else { +not_ok: debug_msg (DBG_IO, "open_ip_file: unable to open `%s' ... ", full_filespec); fptr = NULL; @@ -784,7 +787,10 @@ FILE *open_op_file (void) ** varies according to the operating system. */ #if defined(KPATHSEA) - fptr = fopen(tmp_file_name, FOPEN_W_MODE); + if (kpse_out_name_ok(tmp_file_name)) + fptr = fopen(tmp_file_name, FOPEN_W_MODE); + else + fptr = NULL; #else # if defined(MSDOS) || defined(OS2) fptr = fopen (tmp_file_name, "wt"); @@ -1322,7 +1328,7 @@ void set_array_sizes (void) ** provided, this is displayed first. **============================================================================ */ -void usage (char *printf_fmt, ...) +void usage (const char *printf_fmt, ...) { va_list printf_args; |