Line 0
Link Here
|
|
|
1 |
--- regfilesys.c.orig 2003-11-03 20:24:14 UTC |
2 |
+++ regfilesys.c |
3 |
@@ -114,7 +114,8 @@ int unmapfile(char *buf, int size); |
4 |
/* SysFileSearch(target,file,stem, [options]) */ |
5 |
rxfunc(sysfilesearch) |
6 |
{ |
7 |
- unsigned char *buf, * dptr, *bol, *eol, *eof, *filename, *options, |
8 |
+ char *filename, *options; |
9 |
+ unsigned char *buf, * dptr, *bol, *eol, *eof, |
10 |
*lbuf = NULL; |
11 |
PRXSTRING stem; |
12 |
RXSTRING target; |
13 |
@@ -141,7 +142,7 @@ rxfunc(sysfilesearch) |
14 |
|
15 |
/* map the file into memory. Note that if the OS doesn't support memory- |
16 |
* mapped I/O, this allocates a buffer and reads the file into it. */ |
17 |
- if (!(buf = mapfile(filename, &len))) { |
18 |
+ if (!(buf = (unsigned char *) mapfile((char *) filename, &len))) { |
19 |
rc = 3; |
20 |
} |
21 |
else { |
22 |
@@ -195,7 +196,7 @@ rxfunc(sysfilesearch) |
23 |
i = eol - bol; |
24 |
if (i && bol[i-1] == '\r') |
25 |
i--; |
26 |
- if (cha_adddummy(array, bol, i)) |
27 |
+ if (cha_adddummy(array, (char *) bol, i)) |
28 |
rc = 2; |
29 |
} |
30 |
else { |
31 |
@@ -203,12 +204,12 @@ rxfunc(sysfilesearch) |
32 |
if (!lbuf) |
33 |
rc = 2; |
34 |
else { |
35 |
- i = sprintf(lbuf, "%d:", lines); |
36 |
+ i = sprintf((char *) lbuf, "%d:", lines); |
37 |
memcpy(lbuf+i, bol, eol-bol); |
38 |
i += eol - bol; |
39 |
if (lbuf[i-1] == '\r') |
40 |
i--; |
41 |
- if (cha_addstr(array, lbuf, i)) |
42 |
+ if (cha_addstr(array, (char *) lbuf, i)) |
43 |
rc = 2; |
44 |
} |
45 |
} |
46 |
@@ -222,7 +223,7 @@ rxfunc(sysfilesearch) |
47 |
if (lbuf) |
48 |
free(lbuf); |
49 |
|
50 |
- unmapfile(buf, len); |
51 |
+ unmapfile((char *) buf, len); |
52 |
} |
53 |
|
54 |
result->strlength = sprintf(result->strptr, "%d", rc); |
55 |
@@ -730,8 +731,8 @@ rxfunc(sysfiletree) |
56 |
rc = 2; |
57 |
|
58 |
else { |
59 |
- /* break the list into directory & pattern, so the input can be of |
60 |
- * the form /usr/home/ptjm/*.c */ |
61 |
+// break the list into directory & pattern, so the input can be of |
62 |
+// the form /usr/home/ptjm/*.c |
63 |
|
64 |
dir = pattern; |
65 |
pattern = strrchr(dir, '/'); |