1
diff -rc2 ./fileio.c e:fileio.c
2
*** ./fileio.c Sat Dec 4 19:58:26 1999
3
--- e:fileio.c Sat Dec 4 20:54:10 1999
7
(win_fprintf(pG, strm, (extent)len, (char far *)buf) != (int)(len))
10
+ # define WriteError(buf,len,strm) nlm_WriteError(buf, (extent)(len), strm)
13
# define WriteError(buf,len,strm) \
17
((extent)write(fileno(strm),(char *)(buf),(extent)(len)) != (extent)(len))
22
diff -rc2 ./novell/nlmcfg.h e:novell/nlmcfg.h
23
*** ./novell/nlmcfg.h Sat Dec 4 20:39:20 1999
24
--- e:novell/nlmcfg.h Sat Dec 4 21:20:36 1999
28
# define PutNativeEOL {*q++ = native(CR); *q++ = native(LF);}
29
- # define USE_FWRITE /* write() fails to support textmode output */
30
# if (!defined(NOTIMESTAMP) && !defined(TIMESTAMP))
36
void InitUnZipConsole OF((void));
37
int screenlines OF((void));
38
+ int nlm_WriteError OF((uch *buf, extent len, FILE *strm));
40
diff -rc2 ./novell/novell.c e:novell/novell.c
41
*** ./novell/novell.c Sat Dec 4 21:11:52 1999
42
--- e:novell/novell.c Sat Dec 4 21:28:38 1999
50
---------------------------------------------------------------------------*/
58
+ /*******************************/
59
+ /* Function nlm_WriteError() */
60
+ /*******************************/
62
+ int nlm_WriteError(buf, len, strm)
67
+ /* The write() implementation in the Novell C RTL lacks support of
68
+ text-mode streams (fails to translate '\n' into "CR-LF" when
69
+ writing to text-mode channels like the console).
70
+ In contrast, fwrite() takes into account when an output stream
71
+ was opened in text-mode, but fails to handle output of large
73
+ So, we have to use Unix I/O style write() when emitting data
74
+ to "regular" files but switch over to stdio's fwrite() when
75
+ writing to the console streams.
77
+ if ((strm == stdout)) || (file == stderr)) {
78
+ return ((extent)fwrite((char *)buf, 1, len, strm) != len);
80
+ return ((extent)write(fileno(strm), (char *)buf, len) != len);
82
+ } /* end function nlm_WriteError() */