In sh, is '[' a portable synonym for 'test'?

Doug Gwyn <gwyn> gwyn at brl-tgr.ARPA
Fri Oct 25 00:26:04 AEST 1985


> ...  If you *do*
> have an S5 license, use its shell instead - it's much improved (the S5R2
> version even has Bourne's bastard Algol 68 expunged, finally, although it
> still has the whacky method for storage allocation which causes plenty of
> problems on machines which won't let user-mode code restart or continue
> instructions).

This is real easy to fix.

/*	@(#)blok.c	1.4	*/
...
addblok(reqd)
...
	bloktop = bloktop->word = (struct blk *)(Rcheat(bloktop) + reqd);
#ifdef mc68000	/* or if you just want to be sure */
	/* at this point, bloktop may be beyond the break.  I haven't been
	 * able to make the 68010 allow you to continue from a user bus
	 * trap after executing a signal handler that fixes up the bus
	 * trap, so we'll simply do a more intelligent thing and test
	 * the bloody thing before we use it.  -- Wes Chalfant, FileNet Corp.
	 */
	if ((char *)&bloktop->word >= brkend)
		fault(SIGSEGV);
#endif
	bloktop->word = (struct blk *)(brkbegin + 1);



More information about the Comp.unix.wizards mailing list