[comp.unix.questions] KSH Portability, Example on SGI IRI

carroll@snail.CS.UIUC.EDU (05/08/88)

	Does anyone know if the following is still a bug? It shows up on (as
per comp.lang.c) when you dereference a NULL pointer.

If you type in something like `` or $() , ksh core dumps on Sun's, Sequent's,
and RT's. It does not on 3b's, because you can refer to location 0 without
a problem (you can't *write* it, but you can read it). The problem is that
the function taht deals with command substitution return NULL if there
isn't anything, but the function that calls it does check to see
if that happened, and tries to read a pointer to a structure. We hacked it
to return the same thing as ':' returns if nothing is there.

Alan M. Carroll		amc@woodshop.cs.uiuc.edu	carroll@s.cs.uiuc.edu
Grad Student (TA) / U of Ill - Urbana ...{ihnp4,convex}!uiucdcs!woodshop!amc
	"Too many fools who don't think twice
	 Too many ways to pay the price"  - AP & EW