Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: bug in 3.0.0?



On Aug 21, 12:39pm, Matt Liggett wrote:
- Subject: bug in 3.0.0?
-
- if [[ -z $MAIL ]] {
-     if [[ $OSTYPE = (ultrix4|osf)* ]] {
-        export MAIL=/usr/spool/mail/$USER 
-     } elif [[ $OSTYPE = hpux9* ]] {
-        export MAIL=/usr/mail/$USER 
-     } elif [[ $OSTYPE = solaris2* ]] {
-        export MAIL=/var/mail/$USER 
-     } elif [[ $OSTYPE = sunos4* ]] {
-        export MAIL=/usr/spool/mail/$USER 
-     } else {
-        echo 'WARNING: $MAIL' "not set for $OSTYPE."
-     }
- }

The problem is with "else { ... }".  3.0 wants a "fi" at the end of the
if/elif/else chain, even when using the { ... } form -- but only when
it ends with "else { ... }".

This seems to fix it.

*** Src/parse.c.0	Wed Aug 14 09:43:09 1996
--- Src/parse.c	Wed Aug 21 12:12:50 1996
***************
*** 676,685 ****
  	cmdpush(CS_ELSE);
  	while (tok == SEPER)
  	    yylex();
! 	l = par_list();
! 	if (tok != FI) {
! 	    cmdpop();
! 	    YYERRORV;
  	}
  	addlinknode(thensl, l);
  	nt++;
--- 676,694 ----
  	cmdpush(CS_ELSE);
  	while (tok == SEPER)
  	    yylex();
! 	if (tok == INBRACE) {
! 	    yylex();
! 	    l = par_list();
! 	    if (tok != OUTBRACE) {
! 		cmdpop();
! 		YYERRORV;
! 	    }
! 	} else {
! 	    l = par_list();
! 	    if (tok != FI) {
! 		cmdpop();
! 		YYERRORV;
! 	    }
  	}
  	addlinknode(thensl, l);
  	nt++;

-- 
Bart Schaefer                             Brass Lantern Enterprises
http://www.well.com/user/barts            http://www.nbn.com/people/lantern

New male in /home/schaefer:
>N  2 Justin William Schaefer  Sat May 11 03:43  53/4040  "Happy Birthday"



Messages sorted by: Reverse Date, Date, Thread, Author