Article View: comp.bugs.4bsd
Article #39/usr/ucb/learn has null pointer problems
From: Arnold D. Robbins {EUCC}
Date: Mon, 17 Jul 1989 21:46
Date: Mon, 17 Jul 1989 21:46
76 lines
2566 bytes
2566 bytes
Subject: learn has null pointer bugs
Index: /usr/src/usr.bin/learn/copy.c 4.3BSD
Description:
On a machine that doesn't allow dereferencing null pointers
(say, a Sun 4), learn will die fairly early into the sequence of
lessons in "learn vi."
Repeat-By:
Install learn on a Sun 4.
In deference to the UCB folks, I don't know if the Tahoe version
still has this problem or not.
Fix:
Apply the following context diff to the file copy.c in the learn
source directory.
*** copy.c.orig Thu May 15 20:59:10 1986
--- copy.c Mon Jul 17 17:30:59 1989
***************
*** 49,55 ****
}
r = wordb(s, t); /* t = first token, r = rest */
p = action(t); /* p = token class */
! if (*p == ONCE) { /* some actions done only once per script */
if (wrong && !review) { /* we are on 2nd time */
scopy(fin, NULL);
continue;
--- 49,55 ----
}
r = wordb(s, t); /* t = first token, r = rest */
p = action(t); /* p = token class */
! if (p && *p == ONCE) { /* some actions done only once per script */
if (wrong && !review) { /* we are on 2nd time */
scopy(fin, NULL);
continue;
***************
*** 265,271 ****
if (c == '\n')
break;
if (c == EOF) {
! fflush(fo);
return;
}
if (fo != NULL)
--- 265,272 ----
if (c == '\n')
break;
if (c == EOF) {
! if (fo != NULL)
! fflush(fo);
return;
}
if (fo != NULL)
***************
*** 281,287 ****
}
if (c == '#')
ungetc(c, fi);
! fflush(fo);
}
cmp(r) /* compare two files for status; #cmp f1 f2 [ firstnlinesonly ] */
--- 282,289 ----
}
if (c == '#')
ungetc(c, fi);
! if (fo != NULL)
! fflush(fo);
}
cmp(r) /* compare two files for status; #cmp f1 f2 [ firstnlinesonly ] */
--
Arnold Robbins -- Emory University Computing Center | Unix is a Registered
DOMAIN: arnold@unix.cc.emory.edu | Bell of AT&T Trademark
UUCP: gatech!emoryu1!arnold PHONE: +1 404 727-7636 | Laboratories.
BITNET: arnold@emoryu1 FAX: +1 404 727-2599 | -- Donn Seeley
Technical Details
Message-ID:
<4222@emory.mathcs.emory.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cwjcc!gatech!emory!arnoldShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cwjcc!gatech!emory!arnold
From: arnold@mathcs.emory.edu (Arnold D. Robbins {EUCC})
Newsgroups: comp.bugs.4bsd
Subject: /usr/ucb/learn has null pointer problems
Keywords: all the world is not a vax
Message-ID: <4222@emory.mathcs.emory.edu>
Date: 17 Jul 89 21:46:17 GMT
Organization: Math & Computer Science, Emory University, Atlanta, GA
Lines: 76