nickson@comp.vuw.ac.nz (Ray Nickson) (07/13/89)
ENVIRONMENT: bash 1.01 or 1.02 on an HP300 running MORE/BSD4.3
(although I believe it applies to any system).
SYMPTOM: try the following:
------------------------
bash$ unset auto_resume
bash$ cat
^Z
[1]+ Stopped cat
bash$ cat
^Z
[2]+ Stopped cat
bash$ jobs
[1]- Stopped cat
[2]+ Stopped cat
bash$ kill -KILL %2
[2]+ Killed cat [ aww, poor pussy :-) ]
bash$ jobs
[1]- Stopped cat
bash$ fg
No such job
bash$
-----------------------
BUG: the shell's notion of previous and current job is not always reset when
the current or previous job dies.
FIX: save them. I think the delete_job function is the right place to
do it; I haven't properly checked when cleanup_dead_jobs, but the
following patch to version 1.02's jobs.c appears to work in the above
environment.
-rgn
--
nickson@comp.vuw.ac.nz ...!uunet!vuwcomp!nickson + 64 4 721000x8142
--------------------cut here--------------------
*** jobs.c.orig Thu Jul 13 11:28:39 1989
--- jobs.c Thu Jul 13 11:31:32 1989
***************
*** 272,279 ****
{
register JOB *temp = jobs[index];
! jobs[index] = (JOB *)NULL;
free (temp->wd);
discard_pipeline (temp->pipe);
if (temp->deferred)
--- 272,282 ----
{
register JOB *temp = jobs[index];
! if (index == current_job || index == previous_job)
! reset_current ();
+ jobs[index] = (JOB *)NULL;
+
free (temp->wd);
discard_pipeline (temp->pipe);
if (temp->deferred)