File: xlisp.patch

package info (click to toggle)
audacity 2.1.2-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 86,844 kB
  • sloc: ansic: 225,005; cpp: 221,240; sh: 27,327; python: 16,896; makefile: 8,186; lisp: 8,002; perl: 317; xml: 307; sed: 16
file content (51 lines) | stat: -rw-r--r-- 1,820 bytes parent folder | download | duplicates (2)
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
diff --git a/lib-src/libnyquist/nyquist/xlisp/security.c b/lib-src/libnyquist/nyquist/xlisp/security.c
index 8a5c265..d971567 100644
--- a/lib-src/libnyquist/nyquist/xlisp/security.c
+++ b/lib-src/libnyquist/nyquist/xlisp/security.c
@@ -4,7 +4,9 @@
  */
 
 #include <stdlib.h>
+#ifndef WIN32
 #include <unistd.h>
+#endif
 #include <string.h>
 #include <xlisp.h>
 
@@ -56,13 +58,13 @@ char *safe_write_path = NULL;
 int ok_to_open(const char *filename, const char *mode)
 {
     char fullname[STRMAX];
-    if (index(mode, 'r')) { /* asking for read permission */
+    if (strchr(mode, 'r')) { /* asking for read permission */
 	if (secure_read_path) { /* filename must be in path */
 	    find_full_path(filename, fullname);
 	    if (!in_tree(fullname, secure_read_path)) return FALSE;
 	}
     }
-    if (index(mode, 'w')) { /* asking for write permission */
+    if (strchr(mode, 'w')) { /* asking for write permission */
 	if (safe_write_path) { /* filename must be in path */
 	    find_full_path(filename, fullname);
 	    if (!in_tree(fullname, safe_write_path)) return FALSE;
@@ -98,7 +100,7 @@ void find_full_path(const char *filename, char *fullname)
     /* if windows, replace \ with / to simplify the rest */
     char *loc = fullname;
     if (os_pathchar != '/') {
-        while ((loc = index(loc, os_pathchar))) {
+        while ((loc = strchr(loc, os_pathchar))) {
 	    *loc = '/';
 	}
     }
diff --git a/lib-src/libnyquist/nyquist/xlisp/xlisp.h b/lib-src/libnyquist/nyquist/xlisp/xlisp.h
index 316f982..4e67e47 100644
--- a/lib-src/libnyquist/nyquist/xlisp/xlisp.h
+++ b/lib-src/libnyquist/nyquist/xlisp/xlisp.h
@@ -40,6 +40,7 @@ HISTORY
 #define OFFTYPE		long
 #define SAVERESTORE
 #define XL_LITTLE_ENDIAN 
+#define _longjmp longjmp
 #endif
 
 /* for the Turbo C compiler - MS-DOS, large model */