From 203a9fad044c6d090788ce716ce45c9ad7ba9399 Mon Sep 17 00:00:00 2001 From: Hib Eris Date: Mon, 25 Jan 2010 13:41:09 +0000 Subject: [dvi] Add 'b' to fopen mode for w32 compatibility --- (limited to 'backend') diff --git a/backend/dvi/mdvi-lib/dviread.c b/backend/dvi/mdvi-lib/dviread.c index 285524e..6b37704 100644 --- a/backend/dvi/mdvi-lib/dviread.c +++ b/backend/dvi/mdvi-lib/dviread.c @@ -684,7 +684,7 @@ DviContext *mdvi_init_context(DviParams *par, DviPageSpec *spec, const char *fil perror(file); return NULL; } - p = fopen(filename, "r"); + p = fopen(filename, "rb"); if(p == NULL) { perror(file); mdvi_free(filename); @@ -1008,7 +1008,7 @@ int mdvi_dopage(DviContext *dvi, int pageno) again: if(dvi->in == NULL) { /* try reopening the file */ - dvi->in = fopen(dvi->filename, "r"); + dvi->in = fopen(dvi->filename, "rb"); if(dvi->in == NULL) { mdvi_warning(_("%s: could not reopen file (%s)\n"), dvi->filename, diff --git a/backend/dvi/mdvi-lib/font.c b/backend/dvi/mdvi-lib/font.c index 065b586..0b3d04b 100644 --- a/backend/dvi/mdvi-lib/font.c +++ b/backend/dvi/mdvi-lib/font.c @@ -36,7 +36,7 @@ int font_reopen(DviFont *font) { if(font->in) fseek(font->in, (long)0, SEEK_SET); - else if((font->in = fopen(font->filename, "r")) == NULL) { + else if((font->in = fopen(font->filename, "rb")) == NULL) { DEBUG((DBG_FILES, "reopen(%s) -> Error\n", font->filename)); return -1; } diff --git a/backend/dvi/mdvi-lib/fontmap.c b/backend/dvi/mdvi-lib/fontmap.c index e186bd4..d95ce25 100644 --- a/backend/dvi/mdvi-lib/fontmap.c +++ b/backend/dvi/mdvi-lib/fontmap.c @@ -119,7 +119,7 @@ static int read_encoding(DviEncoding *enc) ASSERT(enc->private == NULL); - in = fopen(enc->filename, "r"); + in = fopen(enc->filename, "rb"); if(in == NULL) { DEBUG((DBG_FMAP, "%s: could not read `%s' (%s)\n", enc->name, enc->filename, strerror(errno))); @@ -267,7 +267,7 @@ static DviEncoding *register_encoding(const char *basefile, int replace) if(filename == NULL) filename = mdvi_strdup(basefile); - in = fopen(filename, "r"); + in = fopen(filename, "rb"); if(in == NULL) { mdvi_free(filename); return NULL; @@ -478,9 +478,9 @@ DviFontMapEnt *mdvi_load_fontmap(const char *file) if(ptr == NULL) ptr = kpse_find_file(file, kpse_dvips_config_format, 0); if(ptr == NULL) - in = fopen(file, "r"); + in = fopen(file, "rb"); else { - in = fopen(ptr, "r"); + in = fopen(ptr, "rb"); mdvi_free(ptr); } if(in == NULL) @@ -728,9 +728,9 @@ static int mdvi_init_fontmaps(void) /* let's ask kpathsea for the file first */ file = kpse_find_file(config, kpse_program_text_format, 0); if(file == NULL) - in = fopen(config, "r"); + in = fopen(config, "rb"); else { - in = fopen(file, "r"); + in = fopen(file, "rb"); mdvi_free(file); } if(in == NULL) @@ -906,7 +906,7 @@ int mdvi_ps_read_fontmap(const char *name) fullname = kpse_path_search(pslibdir, name, 1); else fullname = (char *)name; - in = fopen(fullname, "r"); + in = fopen(fullname, "rb"); if(in == NULL) { if(fullname != name) mdvi_free(fullname); diff --git a/backend/dvi/mdvi-lib/tfmfile.c b/backend/dvi/mdvi-lib/tfmfile.c index cab4f19..b8235bf 100644 --- a/backend/dvi/mdvi-lib/tfmfile.c +++ b/backend/dvi/mdvi-lib/tfmfile.c @@ -81,7 +81,7 @@ int afm_load_file(const char *filename, TFMInfo *info) CharMetricInfo *cm; FILE *in; - in = fopen(filename, "r"); + in = fopen(filename, "rb"); if(in == NULL) return -1; status = afm_parse_file(in, &fi, P_GM); @@ -162,7 +162,7 @@ int tfm_load_file(const char *filename, TFMInfo *info) Int32 *depths; Uint32 checksum; - in = fopen(filename, "r"); + in = fopen(filename, "rb"); if(in == NULL) return -1; tfm = NULL; @@ -445,7 +445,7 @@ static int ofm_load_file(const char *filename, TFMInfo *info) int olevel; int nwords; - in = fopen(filename, "r"); + in = fopen(filename, "rb"); if(in == NULL) return -1; -- cgit v0.9.1