Aucbvax.5410
net.2bsd-bugs
utzoo!decvax!ucbvax!dist2
Mon Dec 7 03:42:37 1981
FIXED: numerous bugs in src/chessclock.c
In addition to not properly dealing with UCB buffered i/o, this
program did raw terminal i/o without properly stripping the eighth bit
off characters read, and always used sh to execute shell escapes
instead of inspecting the environment for a ``SHELL'' variable. The
necessary fixes are:
diff src/chessclock.c.old src/chessclock.c
85a86
> fflush (stdout);
99a101
> fflush (stdout);
105a108,110
> #ifndef V6
> char myshell[BUFSIZ], *shellptr;
> char *strcat (), *strncpy (), *getenv ();
106a112,114
> myshell[0] = '\0';
> shellptr = (char *) NULL;
> #endif V6
113c121
switch (c & 0177) {
121a130
> fflush (stdout);
129a139
> fflush (stdout);
147a158,165
> #ifndef V6
> if (shellptr == (char *) NULL) {
> if ((shellptr = getenv ("SHELL")) == (char *) NULL)
> shellptr = "/bin/sh";
> strncpy (myshell, shellptr, sizeof (myshell) - strlen (shellptr) - 4);
> }
> strcat (myshell, " -t");
> #endif V6
152c170,175
fflush (stdout);
> #ifndef V6
> system (myshell);
> #else
> system ("sh -t");
> #endif V6
154a178
> fflush (stdout);
186a211
> fflush (stdout);
221a247
> fflush (stdout);
These changes should be made on all tapes written before 12/8/81.
Carl
-----------------------------------------------------------------
gopher://quux.org/ conversion by John Goerzen <
[email protected]>
of
http://communication.ucsd.edu/A-News/
This Usenet Oldnews Archive
article may be copied and distributed freely, provided:
1. There is no money collected for the text(s) of the articles.
2. The following notice remains appended to each copy:
The Usenet Oldnews Archive: Compilation Copyright (C) 1981, 1996
Bruce Jones, Henry Spencer, David Wiseman.