summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}