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

Re: two new bugs



> Here are two recent bugs, both certainly since 3.0.0, the second very
> recent.
> 
> 1)
> 
> % foo[1]=bar
> zsh: command not found: foo[1]=bar
> 
> (Did this come with Zoltan's patch to fix the bug that '1foo=bar'
> worked like '1=bar'?  Unfortunately I've since deleted that.)

Yes, it was my patch :-(.  Here is a fix for the fix.  Note that 1[1]=foo
is not an assignment.

Zoltan


*** Src/lex.c	1996/09/14 03:55:08	2.45
--- Src/lex.c	1996/09/18 22:08:52
***************
*** 859,870 ****
  		}
  	    } else if (!sub && peek != ENVSTRING &&
  		       incmdpos && !bct && !brct) {
! 		e = 0;
! 		if (idigit(*tokstr))
! 		    while (++e < len && idigit(tokstr[e]));
! 		else
! 		    while (iident(tokstr[e]) && ++e < len);
! 		if (e == len) {
  		    e = hgetc();
  		    if (e == '(' && incmdpos) {
  			*bptr = '\0';
--- 859,875 ----
  		}
  	    } else if (!sub && peek != ENVSTRING &&
  		       incmdpos && !bct && !brct) {
! 		char *t = tokstr;
! 		if (idigit(*t))
! 		    while (++t < bptr && idigit(*t));
! 		else {
! 		    while (iident(*t) && ++t < bptr);
! 		    if (t < bptr) {
! 			*bptr = '\0';
! 			skipparens(Inbrack, Outbrack, &t);
! 		    }
! 		}
! 		if (t == bptr) {
  		    e = hgetc();
  		    if (e == '(' && incmdpos) {
  			*bptr = '\0';



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