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

Re: % bug in beta20-test1



mason@xxxxxxxxxxxxx wrote:
> % %
> zsh: command not found: fg

This is supposed to fixed this (plus the same bug which occurred with
autoresume).

> I also had it not recognising "fg", and had to do "builtin fg" though I
> can't reproduce that at the moment.

It's assumed not to fix this.

*** Src/exec.c.fg	Tue Jun 11 11:01:27 1996
--- Src/exec.c	Tue Jun 11 11:01:27 1996
***************
*** 1191,1196 ****
--- 1191,1220 ----
  		    }
  		    return;
  		}
+ 	    } else {
+ 		/* If AUTORESUME is set, the command is SIMPLE, and     *
+ 		 * doesn't have any redirections, then check if it      *
+ 		 * matches as a prefix of a job currently in the job    *
+ 		 * table.  If it does, then we treat it as a command to *
+ 		 * resume this job.                                     */
+ 		if (isset(AUTORESUME) && (how & Z_SYNC) && empty(cmd->redir) &&
+ 		    !input && !nextnode(firstnode(args)) && !cmd->flags) {
+ 		    if (unset(NOTIFY))
+ 			scanjobs();
+ 		    if (findjobnam(peekfirst(args)) != -1) {
+ 			pushnode(args, dupstring("fg"));
+ 			checked = 0;
+ 		    }
+ 		}
+ 		/* If the command begins with `%', then assume it is a *
+ 		 * reference to a job in the job table.                */
+ 		if (*(char *)peekfirst(args) == '%') {
+ 		    pushnode(args, dupstring((how & Z_DISOWN)
+ 					     ? "disown" : (how & Z_ASYNC)
+ 					     ? "bg" : "fg"));
+ 		    how = Z_SYNC;
+ 		    checked = 0;
+ 		}
  	    }
  
  	    if (errflag || checked || (cflags & BINF_COMMAND))
***************
*** 1214,1240 ****
  	    hn = NULL;
  	}
      }
- 
-     /* If the command begins with `%', then assume it is a *
-      * reference to a job in the job table.                */
-     if (nonempty(args) && *(char *)peekfirst(args) == '%') {
- 	pushnode(args, dupstring((how & Z_DISOWN)
- 				 ? "disown" : (how & Z_ASYNC) ? "bg" : "fg"));
- 	how = Z_SYNC;
-     }
- 
-     /* If AUTORESUME is set, the command is SIMPLE, and doesn't have *
-      * any redirections, then check if it matches as a prefix of a   *
-      * job currently in the job table.  If it does, then we treat it *
-      * as a command to resume this job.                              */
-     if (isset(AUTORESUME) && type == SIMPLE && (how & Z_SYNC) &&
- 	nonempty(args) && empty(cmd->redir) && !input &&
- 	!nextnode(firstnode(args)) && !cmd->flags) {
- 	if (unset(NOTIFY))
- 	    scanjobs();
- 	if (findjobnam(peekfirst(args)) != -1)
- 	    pushnode(args, dupstring("fg"));
-     }
  
      /* Get the text associated with this command. */
      if (jobbing || (how & Z_TIMED))
--- 1238,1243 ----

-- 
Peter Stephenson <pws@xxxxxx>       Tel: +49 33762 77366
WWW:  http://www.ifh.de/~pws/       Fax: +49 33762 77330
Deutches Electronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen
DESY-IfH, 15735 Zeuthen, Germany.




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