diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2007-03-27 15:16:56 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2007-03-27 15:16:56 +0000 |
commit | 38cdf737943a5279eec91df8caf83185ef92c80a (patch) | |
tree | e07589f92d2f665119a5ceb399e1eaa1399b218e | |
parent | 9fb47cff9d394dc111aeae79a6c99723b1465249 (diff) | |
download | zsh-38cdf737943a5279eec91df8caf83185ef92c80a.tar.gz zsh-38cdf737943a5279eec91df8caf83185ef92c80a.tar.xz zsh-38cdf737943a5279eec91df8caf83185ef92c80a.zip |
unposted: uninitialized variable in 23238
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | Src/jobs.c | 16 |
2 files changed, 10 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog index b80371702..229dc96c6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2007-03-27 Peter Stephenson <pws@csr.com> + * unposted: Src/jobs.c: fix uninitialized variable in 23238. + * 23238: Src/jobs.c: job didn't get deleted from table if it wasn't printed, leading to obscure problems with current jobs. diff --git a/Src/jobs.c b/Src/jobs.c index c201ecd96..53e654c2b 100644 --- a/Src/jobs.c +++ b/Src/jobs.c @@ -821,6 +821,14 @@ printjob(Job jn, int lng, int synch) int doneprint = 0; FILE *fout = (synch == 2) ? stdout : shout; + /* + * Wow, what a hack. Did I really write this? --- pws + */ + if (jn < jobtab || jn >= jobtab + jobtabsize) + job = jn - oldjobtab; + else + job = jn - jobtab; + if (jn->stat & STAT_NOPRINT) { if (jn->stat & STAT_DONE) { deletejob(jn); @@ -834,14 +842,6 @@ printjob(Job jn, int lng, int synch) return 0; } - /* - * Wow, what a hack. Did I really write this? --- pws - */ - if (jn < jobtab || jn >= jobtab + jobtabsize) - job = jn - oldjobtab; - else - job = jn - jobtab; - if (lng < 0) { conted = 1; lng = !!isset(LONGLISTJOBS); |