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

eval bugfix when IFS[1] != ' '



The bug:
turan% foo=a/b/c 
turan% setopt shwordsplit 
turan% (IFS=/ ; eval echo $foo)
zsh: no such file or directory: echo/a/b/c

Similar problem can occur with sched.

The fix also removes an unnecessary ztrdup/zsfree pair, and corrects a
comment.

Zoltan

*** Src/builtin.c.orig	Mon May 29 20:37:13 1995
--- Src/builtin.c	Mon May 29 20:36:33 1995
***************
*** 4908,4924 ****
      return ret ? ret : lastval;
  }
  
! /* eval: simple mathematical evaluation */
  
  /**/
  int
  bin_eval(char *nam, char **argv, char *ops, int func)
  {
-     char *s = ztrdup(spacejoin(argv));
      List list;
  
!     hungets(s);
!     zsfree(s);
      strinbeg();
      if (!(list = parse_list())) {
  	hflush();
--- 4908,4922 ----
      return ret ? ret : lastval;
  }
  
! /* eval: simple evaluation */
  
  /**/
  int
  bin_eval(char *nam, char **argv, char *ops, int func)
  {
      List list;
  
!     hungets(join(argv, ' '));
      strinbeg();
      if (!(list = parse_list())) {
  	hflush();
***************
*** 5492,5498 ****
      of scheduled commands. */
      sch = (struct schedcmd *)zcalloc(sizeof *sch);
      sch->time = t;
!     sch->cmd = ztrdup(spacejoin(argv));
      sch->next = NULL;
      for (sch2 = (struct schedcmd *)&schedcmds; sch2->next; sch2 = sch2->next);
      sch2->next = sch;
--- 5490,5496 ----
      of scheduled commands. */
      sch = (struct schedcmd *)zcalloc(sizeof *sch);
      sch->time = t;
!     sch->cmd = ztrdup(join(argv, ' '));
      sch->next = NULL;
      for (sch2 = (struct schedcmd *)&schedcmds; sch2->next; sch2 = sch2->next);
      sch2->next = sch;



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