about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2006-11-06 12:49:20 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2006-11-06 12:49:20 +0000
commitda0dfc62df8ca884cdc27bb9fd26e520873e4c71 (patch)
tree834d56c370e252859b8b30b9a2261ca61e73d189
parenta519a6d15ccbb429a112ed7b8f4594a51948629d (diff)
downloadzsh-da0dfc62df8ca884cdc27bb9fd26e520873e4c71.tar.gz
zsh-da0dfc62df8ca884cdc27bb9fd26e520873e4c71.tar.xz
zsh-da0dfc62df8ca884cdc27bb9fd26e520873e4c71.zip
fix error message
-rw-r--r--ChangeLog5
-rw-r--r--Src/exec.c2
-rw-r--r--Src/jobs.c2
3 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index c63e50bcd..b75cc367b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-11-06  Peter Stephenson  <pws@csr.com>
+
+	* 22971: Src/exec.c, Src/jobs.c: don't allow job control
+	on jobs in current shell and sanitize error message used.
+
 2006-11-05  Peter Stephenson  <p.w.stephenson@ntlworld.com>
 
 	* 22968: Src/builtins.c: print -z and print -s didn't cope
diff --git a/Src/exec.c b/Src/exec.c
index f9866235d..9e2ac1477 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -2265,7 +2265,7 @@ execcmd(Estate state, int input, int output, int how, int last1)
 	/* This is a current shell procedure that didn't need to fork.    *
 	 * This includes current shell procedures that are being exec'ed, *
 	 * as well as null execs.                                         */
-	jobtab[thisjob].stat |= STAT_CURSH;
+	jobtab[thisjob].stat |= STAT_CURSH|STAT_NOPRINT;
     } else {
 	/* This is an exec (real or fake) for an external command.    *
 	 * Note that any form of exec means that the subshell is fake *
diff --git a/Src/jobs.c b/Src/jobs.c
index 166314e74..12e0a16f3 100644
--- a/Src/jobs.c
+++ b/Src/jobs.c
@@ -1771,7 +1771,7 @@ bin_fg(char *name, char **argv, Options ops, int func)
 	}
 	if (!(jobtab[job].stat & STAT_INUSE) ||
 	    (jobtab[job].stat & STAT_NOPRINT)) {
-	    zwarnnam(name, "no such job: %d", job);
+	    zwarnnam(name, "%%%d: no such job", job);
 	    unqueue_signals();
 	    return 1;
 	}