summaryrefslogtreecommitdiff
path: root/Build/source/texk/lcdf-typetools/lcdf-typetools-2.95-PATCHES/patch-20-TL-binary
blob: 1704861c1741e1ea7b8e9b1bfec2e36e374299a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
	In TeX Live we treat all output files as binary.

diff -ur -x Makefile.in -x aclocal.m4 -x autoconf.h.in -x configure lcdf-typetools-2.95.orig/liblcdf/filename.cc lcdf-typetools-2.95/liblcdf/filename.cc
--- lcdf-typetools-2.95.orig/liblcdf/filename.cc	2012-09-17 00:17:57.000000000 +0200
+++ lcdf-typetools-2.95/liblcdf/filename.cc	2012-09-24 19:11:32.000000000 +0200
@@ -126,5 +126,5 @@
     if (_actual || !_path)
 	return _actual;
     else
-	return fopen(_path.c_str(), binary ? "wb" : "w");
+	return fopen(_path.c_str(), "wb");
 }
diff -ur -x Makefile.in -x aclocal.m4 -x autoconf.h.in -x configure lcdf-typetools-2.95.orig/otftotfm/automatic.cc lcdf-typetools-2.95/otftotfm/automatic.cc
--- lcdf-typetools-2.95.orig/otftotfm/automatic.cc	2012-09-17 00:17:57.000000000 +0200
+++ lcdf-typetools-2.95/otftotfm/automatic.cc	2012-09-24 19:13:32.000000000 +0200
@@ -311,7 +311,7 @@
     String ls_r = writable_texdir + "ls-R";
     bool success = false;
     if (access(ls_r.c_str(), R_OK) >= 0) // make sure it already exists
-	if (FILE *f = fopen(ls_r.c_str(), "a")) {
+	if (FILE *f = fopen(ls_r.c_str(), "ab")) {
 	    fprintf(f, "./%s:\n%s\n", directory.c_str(), file.c_str());
 	    success = true;
 	    fclose(f);
@@ -678,7 +678,7 @@
 #endif
 	{
 	    fclose(f);
-	    f = fopen(map_file.c_str(), "w");
+	    f = fopen(map_file.c_str(), "wb");
 	    fd = fileno(f);
 	}
 
diff -ur -x Makefile.in -x aclocal.m4 -x autoconf.h.in -x configure lcdf-typetools-2.95.orig/otftotfm/otftotfm.cc lcdf-typetools-2.95/otftotfm/otftotfm.cc
--- lcdf-typetools-2.95.orig/otftotfm/otftotfm.cc	2012-09-17 00:17:57.000000000 +0200
+++ lcdf-typetools-2.95/otftotfm/otftotfm.cc	2012-09-24 19:15:23.000000000 +0200
@@ -555,7 +555,7 @@
 
     if (verbose)
 	errh->message("creating %s", filename.c_str());
-    FILE *f = fopen(filename.c_str(), "w");
+    FILE *f = fopen(filename.c_str(), "wb");
     if (!f) {
 	errh->error("%s: %s", filename.c_str(), strerror(errno));
 	return;
@@ -997,7 +997,7 @@
 #endif
     {
 	fclose(f);
-	f = fopen(filename.c_str(), "w");
+	f = fopen(filename.c_str(), "wb");
 	fd = fileno(f);
     }
 
diff -ur -x Makefile.in -x aclocal.m4 -x autoconf.h.in -x configure lcdf-typetools-2.95.orig/t1dotlessj/t1dotlessj.cc lcdf-typetools-2.95/t1dotlessj/t1dotlessj.cc
--- lcdf-typetools-2.95.orig/t1dotlessj/t1dotlessj.cc	2012-09-17 00:17:57.000000000 +0200
+++ lcdf-typetools-2.95/t1dotlessj/t1dotlessj.cc	2012-09-24 19:21:49.000000000 +0200
@@ -403,10 +403,10 @@
     // write it to output
     if (!outputf)
 	outputf = stdout;
-    if (binary) {
 #if defined(_MSDOS) || defined(_WIN32)
-	_setmode(_fileno(outputf), _O_BINARY);
+    _setmode(_fileno(outputf), _O_BINARY);
 #endif
+    if (binary) {
 	Type1PFBWriter w(outputf);
 	dotless_font->write(w);
     } else {
diff -ur -x Makefile.in -x aclocal.m4 -x autoconf.h.in -x configure lcdf-typetools-2.95.orig/t1rawafm/t1rawafm.cc lcdf-typetools-2.95/t1rawafm/t1rawafm.cc
--- lcdf-typetools-2.95.orig/t1rawafm/t1rawafm.cc	2012-09-24 18:38:53.000000000 +0200
+++ lcdf-typetools-2.95/t1rawafm/t1rawafm.cc	2012-09-24 19:20:16.000000000 +0200
@@ -352,6 +352,9 @@
 	if (!outf)
 	    errh->fatal("%s: %s", output_file, strerror(errno));
     }
+#if defined(_MSDOS) || defined(_WIN32)
+    _setmode(_fileno(outf), _O_BINARY);
+#endif
 
     write_afm(outf, font);
 
diff -ur -x Makefile.in -x aclocal.m4 -x autoconf.h.in -x configure lcdf-typetools-2.95.orig/t1reencode/t1reencode.cc lcdf-typetools-2.95/t1reencode/t1reencode.cc
--- lcdf-typetools-2.95.orig/t1reencode/t1reencode.cc	2012-09-17 00:17:57.000000000 +0200
+++ lcdf-typetools-2.95/t1reencode/t1reencode.cc	2012-09-24 19:19:25.000000000 +0200
@@ -1094,10 +1094,10 @@
 	if (!outf)
 	    errh->fatal("%s: %s", output_file, strerror(errno));
     }
-    if (binary) {
 #if defined(_MSDOS) || defined(_WIN32)
-	_setmode(_fileno(outf), _O_BINARY);
+    _setmode(_fileno(outf), _O_BINARY);
 #endif
+    if (binary) {
 	Type1PFBWriter w(outf);
 	font->write(w);
     } else {
diff -ur -x Makefile.in -x aclocal.m4 -x autoconf.h.in -x configure lcdf-typetools-2.95.orig/t1testpage/t1testpage.cc lcdf-typetools-2.95/t1testpage/t1testpage.cc
--- lcdf-typetools-2.95.orig/t1testpage/t1testpage.cc	2012-09-17 00:17:57.000000000 +0200
+++ lcdf-typetools-2.95/t1testpage/t1testpage.cc	2012-09-24 19:17:41.000000000 +0200
@@ -665,6 +665,9 @@
 	if (!outf)
 	    errh->fatal("%s: %s", output_file, strerror(errno));
     }
+#if defined(_MSDOS) || defined(_WIN32)
+    _setmode(_fileno(outf), _O_BINARY);
+#endif
 
     //font->undo_synthetic();