File: quick_fix.patch

package info (click to toggle)
lyx 1.3.4-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 41,996 kB
  • ctags: 28,239
  • sloc: cpp: 169,428; sh: 11,309; ansic: 6,029; perl: 3,828; python: 1,659; makefile: 1,554; yacc: 356; tcl: 163; sed: 72
file content (257 lines) | stat: -rw-r--r-- 7,909 bytes parent folder | download | duplicates (4)
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
Index: lyx-devel/config/progtest.m4
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/config/progtest.m4,v
retrieving revision 1.2
diff -u -r1.2 progtest.m4
--- lyx-devel/config/progtest.m4	2000/01/08 21:02:55	1.2
+++ lyx-devel/config/progtest.m4	2001/01/01 01:09:00
@@ -11,6 +11,19 @@
 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
 dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
 AC_DEFUN(AM_PATH_PROG_WITH_TEST,
+[case "`uname -s 2> /dev/null`" in
+OS/2)
+  PATH=`echo -E "$PATH" | sed 's+\\\\+/+g'`
+  PATH_IFS=';'
+  EXE_EXT='.exe'
+  CMD_EXT='.cmd'
+  ;;
+*)
+  PATH_IFS=':'
+  EXE_EXT=''
+  CMD_EXT=''
+  ;;
+esac]
 [# Extract the first word of "$2", so it can be a program name with args.
 set dummy $2; ac_word=[$]2
 AC_MSG_CHECKING([for $ac_word])
@@ -20,10 +33,12 @@
   ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
   ;;
   *)
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}$PATH_IFS"
   for ac_dir in ifelse([$5], , $PATH, [$5]); do
     test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
+    if test -f $ac_dir/$ac_word \
+	 -o -f $ac_dir/$ac_word$EXE_EXT \
+	 -o -f $ac_dir/$ac_word$CMD_EXT; then
       if [$3]; then
 	ac_cv_path_$1="$ac_dir/$ac_word"
 	break
Index: lyx-devel/lib/configure.m4
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/configure.m4,v
retrieving revision 1.17
diff -u -r1.17 configure.m4
--- lyx-devel/lib/configure.m4	2000/11/21 15:45:42	1.17
+++ lyx-devel/lib/configure.m4	2001/01/01 01:09:05
@@ -28,6 +28,19 @@
 dnl
 define(SEARCH_PROG,[dnl
 changequote([,])dnl
+case "`uname -s 2> /dev/null`" in
+OS/2)
+  PATH=`echo -E "$PATH" | sed 's+\\\\+/+g'`
+  PATH_IFS=';'
+  EXE_EXT='.exe'
+  CMD_EXT='.cmd'
+  ;;
+*)
+  PATH_IFS=':'
+  EXE_EXT=''
+  CMD_EXT=''
+  ;;
+esac
 MSG_CHECKING($1)
 MSG_RESULT(($3))
 $2=
@@ -37,10 +50,12 @@
 set dummy $ac_prog ; ac_word=$[2]
 if test -n "$ac_word"; then
   MSG_CHECKING([for \"$ac_word\"],[+])
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="$PATH_IFS"
   for ac_dir in $PATH; do
     test -z "$ac_dir" && ac_dir=.
-    if test -x [$ac_dir/$ac_word]; then
+    if test -x [$ac_dir/$ac_word] \
+	-o -x [$ac_dir/$ac_word$EXE_EXT] \
+	-o -x [$ac_dir/$ac_word$CMD_EXT]; then
       $2="$ac_prog"
       break
     fi
@@ -180,8 +195,17 @@
 fi
 
 # Search for an installed reLyX or a ready-to-install one
+case "`uname -s 2> /dev/null`" in
+OS/2)
+save_PATH=`echo -E "$PATH" | sed 's+\\\\+/+g'`
+PATH_IFS=';'
+;;
+*)
 save_PATH=${PATH}
-PATH=${PATH}:./reLyX/
+PATH_IFS=':'
+;;
+esac
+PATH=${PATH}${PATH_IFS}./reLyX/
 SEARCH_PROG([for a LaTeX -> LyX converter],tex_to_lyx_command,reLyX)
 PATH=${save_PATH}
 test $tex_to_lyx_command = "reLyX" && tex_to_lyx_command="reLyX -f \$\$i"
Index: lyx-devel/lib/reLyX/acinclude.m4
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/reLyX/acinclude.m4,v
retrieving revision 1.2
diff -u -r1.2 acinclude.m4
--- lyx-devel/lib/reLyX/acinclude.m4	2000/11/07 12:07:13	1.2
+++ lyx-devel/lib/reLyX/acinclude.m4	2001/01/01 01:09:06
@@ -10,15 +10,24 @@
 dnl RELYX_SEARCH_PROG(VARIABLE-NAME,PROGRAMS-LIST,ACTION-IF-FOUND)
 dnl             
 define(RELYX_SEARCH_PROG,[dnl
+case "`uname -s 2> /dev/null`" in
+OS/2)
+  PATH=`echo -E "$PATH" | sed 's+\\\\+/+g'`
+  PATH_IFS=';'
+  ;;
+*)
+  PATH_IFS=':'
+  ;;
+esac
 for ac_prog in $2 ; do
 # Extract the first word of "$ac_prog", so it can be a program name with
 # args.
   set dummy $ac_prog ; ac_word=$[2]
   if test ! -n "[$]$1"; then
-    IFS="${IFS=         }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+    IFS="${IFS=         }"; ac_save_ifs="$IFS"; IFS="${IFS}$PATH_IFS"
     for ac_dir in $PATH; do
       test -z "$ac_dir" && ac_dir=.
-      if test -f [$ac_dir/$ac_word]; then
+      if test -f [$ac_dir/$ac_word] -o -f [$ac_dir/$ac_word$ac_exeext]; then
         $1="$ac_prog"
         break
       fi
Index: lyx-devel/lib/reLyX/configure.in
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/reLyX/configure.in,v
retrieving revision 1.8
diff -u -r1.8 configure.in
--- lyx-devel/lib/reLyX/configure.in	2000/06/26 15:33:12	1.8
+++ lyx-devel/lib/reLyX/configure.in	2001/01/01 01:09:06
@@ -2,6 +2,7 @@
 AC_INIT(reLyX.in)
 AC_PREREQ(2.13) dnl We want to use autoconf 2.13
 AC_CONFIG_AUX_DIR(../../config)
+AC_EXEEXT
 
 dnl PACKAGE=reLyX
 dnl Do this to install in $datadir/lyx/reLyX instead of $datadir/reLyX/reLyX
Index: lyx-devel/src/os2_defines.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/os2_defines.h,v
retrieving revision 1.5
diff -u -r1.5 os2_defines.h
--- lyx-devel/src/os2_defines.h	2000/11/08 09:39:44	1.5
+++ lyx-devel/src/os2_defines.h	2001/01/01 01:09:07
@@ -13,16 +13,22 @@
 #ifndef OS2_DEFINES_H
 #define OS2_DEFINES_H
 
+#if defined (__cplusplus)
 #include <cctype>
-#include <process.h>
 #include <cstdlib>
+extern "C" inline int readlink(const char *, char *, size_t) {return -1;}
+#else
+#include <ctype.h>
+#include <stdlib.h>
+#define readlink(s, t, l) (-1)
+#endif
+#include <process.h>
 #include <unistd.h>
 #include <X11/Xlocale.h>
 /* #include <malloc.h> */
 #define lstat stat
 #define S_ISLNK(x) false
 #define S_ISBLK(x) false
-#define readlink(s, t, l) (strcpy(t, s), strlen(t))
 /*#define mkfifo(p, m) (0) *//* LyXserver is temporary disabled. */
 #define chdir _chdir2
 #define strcasecmp stricmp
Index: lyx-devel/src/support/rename.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/rename.C,v
retrieving revision 1.5
diff -u -r1.5 rename.C
--- lyx-devel/src/support/rename.C	2000/11/13 10:35:02	1.5
+++ lyx-devel/src/support/rename.C	2001/01/01 01:09:10
@@ -6,6 +6,9 @@
 
 bool lyx::rename(string const & from, string const & to)
 {
+#ifdef __EMX__
+	::unlink(to.c_str());
+#endif
 	if (::rename(from.c_str(), to.c_str()) == -1)
 		if (lyx::copy(from, to)) {
 			lyx::unlink(from);
Index: lyx-devel/src/support/syscall.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/syscall.C,v
retrieving revision 1.18
diff -u -r1.18 syscall.C
--- lyx-devel/src/support/syscall.C	2000/10/11 21:06:43	1.18
+++ lyx-devel/src/support/syscall.C	2001/01/01 01:09:10
@@ -15,6 +15,7 @@
 #include "syscontr.h"
 #include "support/lstrings.h"
 #include "support/lyxlib.h"
+#include "support/filetools.h"
 
 using std::endl;
 
Index: lyx-devel/src/support/tempname.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/tempname.C,v
retrieving revision 1.4
diff -u -r1.4 tempname.C
--- lyx-devel/src/support/tempname.C	2000/11/15 03:22:08	1.4
+++ lyx-devel/src/support/tempname.C	2001/01/01 01:09:10
@@ -12,6 +12,17 @@
 
 extern string system_tempdir;
 
+#ifdef __EMX__
+	// EMX mkstemp() behaviour may be problematic, however,
+	// as noted by Lgb in the comment to CreateTmpDir(),
+	// there is no point for using mkstemp() here.
+#undef HAVE_MKSTEMP
+#include <sys/types.h>
+#include <sys/stat.h>
+#define INCL_DOSFILEMGR
+#include <os2.h>
+#endif
+
 static inline
 int make_tempfile(char * templ) 
 {
@@ -19,9 +30,14 @@
 	return ::mkstemp(templ);
 #else
 #ifdef HAVE_MKTEMP
+#ifdef __EMX__
+	ULONG cur = 0;
+	LONG  req = 1;
+	DosSetRelMaxFH(&req, &cur);	// No need to check error code.
+#endif
 	// This probably just barely works...
 	::mktemp(templ);
-	return ::open(templ, O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
+	return ::open(templ, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
 #else
 #warning FIX FIX FIX
 #endif