|
|
1.1 root 1: 6d5
2: < #include "fcntl.h"
3: 8,11d6
4: < #ifndef O_WRONLY
5: < #define O_RDONLY 0
6: < #define O_WRONLY 1
7: < #endif
8: 15d9
9: < extern FILE *fdopen();
10: 28c22
11: < char *f__w_mode[2] = {"w", "w"};
12: ---
13: > char *f__w_mode[4] = {"w", "w", "r+w", "r+w"};
14: 31c25
15: < char *f__w_mode[2] = {"wb", "w"};
16: ---
17: > char *f__w_mode[4] = {"wb", "w", "r+b", "r+"};
18: 40c34
19: < #ifdef MSDOS
20: ---
21: > #ifdef NON_UNIX_STDIO
22: 79c73,74
23: < char buf[256];
24: ---
25: > integer rv;
26: > char buf[256], *s;
27: 81c76,78
28: < #ifndef MSDOS
29: ---
30: > #ifdef NON_UNIX_STDIO
31: > FILE *tf;
32: > #else
33: 94c91
34: < #ifdef MSDOS
35: ---
36: > #ifdef NON_UNIX_STDIO
37: 107c104,105
38: < if((n=f_clos(&x))!=0) return(n);
39: ---
40: > if ((rv = f_clos(&x)) != 0)
41: > return rv;
42: 109c107
43: < b->url=a->orl;
44: ---
45: > b->url = (int)a->orl;
46: 133c131
47: < #ifdef MSDOS
48: ---
49: > #ifdef NON_UNIX_STDIO
50: 149,150c147
51: < (void) close(creat(buf, 0666));
52: < break;
53: ---
54: > goto replace;
55: 153c150
56: < #ifdef MSDOS
57: ---
58: > #ifdef NON_UNIX_STDIO
59: 161a159,163
60: > replace:
61: > #ifdef NON_UNIX_STDIO
62: > if (tf = fopen(buf,f__w_mode[0]))
63: > fclose(tf);
64: > #else
65: 163c165
66: < break;
67: ---
68: > #endif
69: 176,177c178,180
70: < if((b->ufd = fopen(buf, f__r_mode[b->ufmt])) == NULL) {
71: < if ((n = open(buf,O_WRONLY)) >= 0) {
72: ---
73: > if(!(b->ufd = fopen(buf, f__r_mode[b->ufmt]))) {
74: > #ifdef NON_UNIX_STDIO
75: > if (b->ufd = fopen(buf, f__w_mode[b->ufmt+2]))
76: 179c182,187
77: < }
78: ---
79: > else if (b->ufd = fopen(buf, f__w_mode[b->ufmt]))
80: > b->uwrt = 1;
81: > else
82: > #else
83: > if ((n = open(buf,O_WRONLY)) >= 0)
84: > b->uwrt = 2;
85: 185a194
86: > #endif
87: 190c199
88: < #ifndef MSDOS
89: ---
90: > #ifndef NON_UNIX_STDIO
91: 194c203,208
92: < if(a->orl && b->useek) rewind(b->ufd);
93: ---
94: > if(b->useek)
95: > if (a->orl)
96: > rewind(b->ufd);
97: > else if ((s = a->oacc) && (*s == 'a' || *s == 'A')
98: > && fseek(b->ufd, 0L, SEEK_END))
99: > err(a->oerr,129,"open");
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.