From owner-freebsd-hackers Mon Jul 24 00:02:01 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.11/8.6.6) id AAA06511 for hackers-outgoing; Mon, 24 Jul 1995 00:02:01 -0700 Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.34]) by freefall.cdrom.com (8.6.11/8.6.6) with ESMTP id AAA06486 for ; Mon, 24 Jul 1995 00:01:25 -0700 Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.9/8.6.9) id QAA05582; Mon, 24 Jul 1995 16:57:15 +1000 Date: Mon, 24 Jul 1995 16:57:15 +1000 From: Bruce Evans Message-Id: <199507240657.QAA05582@godzilla.zeta.org.au> To: hackers@freebsd.org, peter@bonkers.taronga.com Subject: Re: make weirdness Sender: hackers-owner@freebsd.org Precedence: bulk >>So, why didn't the old sh complain? Of course I dunno. >The old sh didn't complain because an empty statement is a perfectly valid >statement. I did some checking: it looks like complaining about this syntax >is a System-V-ism. IMHO ignoring empty statements is the right thing to do, >from a language perspective. It seems to be required by POSIX. Bash complains. >1.1.5.1: >$ ; ; ; ; ; >$ >BSDI: >$ ; ; ; ; ; >$ >2.0.5 (freefall): >$ ; ; ; ; ; >Syntax error: ";" unexpected pre-2.0 through pre-2.2 (here) $ ; ; ; ; ; $ :-) I use this change which was one of Jim Wilson's fixes for 1.1.5. I wanted it mainly for the TEOF handling. --- *** parser.c~ Wed May 31 14:54:04 1995 --- parser.c Wed May 31 14:54:17 1995 *************** *** 443,447 **** --- 443,450 ---- break; /* Handle an empty command like other simple commands. */ + case TSEMI: case TNL: + /* Handle EOF like other simple commands, too. */ + case TEOF: case TWORD: tokpushback++; ---