Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Jul 1995 16:57:15 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        hackers@freebsd.org, peter@bonkers.taronga.com
Subject:   Re: make weirdness
Message-ID:  <199507240657.QAA05582@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>>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++;
---



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199507240657.QAA05582>