diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2012-07-10 13:10:15 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2012-07-10 13:10:15 +0000 |
commit | 0b3bba83b27e7696478906c36aca1b7db1426ab8 (patch) | |
tree | cae5ecafa4cb1bb9e6550d6c6024309b7dcaed51 | |
parent | d3799c971411d98aa4b10e08e4f670fac4ffbf68 (diff) |
ps2pkm: Use binary mode for output files (from W32TeX)
git-svn-id: svn://tug.org/texlive/trunk@26990 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Build/source/texk/ps2pkm/ChangeLog | 6 | ||||
-rw-r--r-- | Build/source/texk/ps2pkm/mag.c | 4 | ||||
-rw-r--r-- | Build/source/texk/ps2pkm/pfb2pfa.c | 22 | ||||
-rw-r--r-- | Build/source/texk/ps2pkm/pk2bm.c | 4 |
4 files changed, 21 insertions, 15 deletions
diff --git a/Build/source/texk/ps2pkm/ChangeLog b/Build/source/texk/ps2pkm/ChangeLog index 2d52629781f..ba910f4e3ec 100644 --- a/Build/source/texk/ps2pkm/ChangeLog +++ b/Build/source/texk/ps2pkm/ChangeLog @@ -1,3 +1,9 @@ +2012-07-10 Peter Breitenlohner <peb@mppmu.mpg.de> + + * mag.c, pk2bm.c: Use binary mode for output files (from W32TeX). + + * pfb2pfa.c: Drop unused ambiguous code. + 2011-07-19 Peter Breitenlohner <peb@mppmu.mpg.de> * type1.c [FABS, CEIL, FLOOR]: Use routines from libm, the diff --git a/Build/source/texk/ps2pkm/mag.c b/Build/source/texk/ps2pkm/mag.c index 46bc55acd7d..f5c341bbc74 100644 --- a/Build/source/texk/ps2pkm/mag.c +++ b/Build/source/texk/ps2pkm/mag.c @@ -113,6 +113,10 @@ int main(int argc, char *argv[]) { if (argc < 1) fatal("Usage: %s [-r] [-Rdpi] size . . .\n", myname); +#ifdef WIN32 + setmode(fileno(stdout), _O_BINARY); +#endif + for ( ; argc; argc--, argv++) { arg=atof(argv[0]); switch (invert) { diff --git a/Build/source/texk/ps2pkm/pfb2pfa.c b/Build/source/texk/ps2pkm/pfb2pfa.c index 546467b761c..40a9c162fea 100644 --- a/Build/source/texk/ps2pkm/pfb2pfa.c +++ b/Build/source/texk/ps2pkm/pfb2pfa.c @@ -32,7 +32,7 @@ int main (int argc, char *argv[]) { unsigned int t, l, i; - unsigned int l1, l2, l3, l4; + unsigned int l1, l2, l3, l4; short c, done, verbose = 0; FILE *pfb, *pfa; char *pfbname, *pfaname = NULL, *myname = "pfb2pfa"; @@ -71,13 +71,9 @@ int main (int argc, char *argv[]) if (verbose) printf("Type: %d, ", t); switch (t) { case 1: -#if 1 - l1 = getc(pfb); l2 = getc(pfb); l3 = getc(pfb); l4 = getc(pfb); - l = l1 | l2 << 8 | l3 << 16 | l4 << 24; - /* printf("%2x %2x %2x %2x -> %x\n", l1, l2, l3, l4, l); */ -#else - l = (getc(pfb)) | (getc(pfb)<<8) | (getc(pfb)<<16) | (getc(pfb)<<24); -#endif + l1 = getc(pfb); l2 = getc(pfb); l3 = getc(pfb); l4 = getc(pfb); + l = l1 | l2 << 8 | l3 << 16 | l4 << 24; + /* printf("%2x %2x %2x %2x -> %x\n", l1, l2, l3, l4, l); */ if (verbose) printf(" plain text, length %d\n", l); for (i=0; i < l ; i++) { c = getc(pfb); @@ -86,13 +82,9 @@ int main (int argc, char *argv[]) } break; case 2: -#if 1 - l1 = getc(pfb); l2 = getc(pfb); l3 = getc(pfb); l4 = getc(pfb); - l = l1 | l2 << 8 | l3 << 16 | l4 << 24; - /* printf("%2x %2x %2x %2x -> %x\n", l1, l2, l3, l4, l); */ -#else - l = (getc(pfb)) | (getc(pfb)<<8) | (getc(pfb)<<16) | (getc(pfb)<<24); -#endif + l1 = getc(pfb); l2 = getc(pfb); l3 = getc(pfb); l4 = getc(pfb); + l = l1 | l2 << 8 | l3 << 16 | l4 << 24; + /* printf("%2x %2x %2x %2x -> %x\n", l1, l2, l3, l4, l); */ if (verbose) printf(" binary data, length %d\n", l); for(i = 0; i < l ;i++) { fprintf(pfa, "%02x", getc(pfb)); diff --git a/Build/source/texk/ps2pkm/pk2bm.c b/Build/source/texk/ps2pkm/pk2bm.c index baa9ddd8f4d..918e872b93b 100644 --- a/Build/source/texk/ps2pkm/pk2bm.c +++ b/Build/source/texk/ps2pkm/pk2bm.c @@ -91,6 +91,10 @@ int main(int argc, char *argv[]) exit(1); } +#ifdef WIN32 + setmode(fileno(stdout), _O_BINARY); +#endif + pkname = argv[0]; if (readchar(pkname, C, &cd)) { |