From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16960 invoked from network); 17 Feb 2004 10:41:40 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 17 Feb 2004 10:41:40 -0000 Received: (qmail 27090 invoked by alias); 17 Feb 2004 10:41:29 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 19427 Received: (qmail 27075 invoked from network); 17 Feb 2004 10:41:28 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 17 Feb 2004 10:41:28 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [62.189.58.19] by sunsite.dk (MessageWall 1.0.8) with SMTP; 17 Feb 2004 10:41:27 -0000 Received: from MAILSWEEPER01.csr.com (mailhost1.csr.com [62.189.183.235]) by lhuumrelay3.lnd.ops.eu.uu.net (8.11.0/8.11.0) with ESMTP id i1HAfQv08028 for ; Tue, 17 Feb 2004 10:41:26 GMT Received: from EXCHANGE02.csr.com (unverified [192.168.137.45]) by MAILSWEEPER01.csr.com (Content Technologies SMTPRS 4.3.12) with ESMTP id for ; Tue, 17 Feb 2004 10:41:09 +0000 Received: from csr.com ([192.168.144.127]) by EXCHANGE02.csr.com with Microsoft SMTPSVC(5.0.2195.5329); Tue, 17 Feb 2004 10:42:24 +0000 To: zw Subject: Re: jobs not listing all commands In-reply-to: "Felix Rosencrantz"'s message of "Mon, 16 Feb 2004 23:58:27 PST." <20040217075827.1498.qmail@web10410.mail.yahoo.com> Date: Tue, 17 Feb 2004 10:41:26 +0000 Message-ID: <4434.1077014486@csr.com> From: Peter Stephenson X-OriginalArrivalTime: 17 Feb 2004 10:42:24.0306 (UTC) FILETIME=[BA8E9920:01C3F542] Felix Rosencrantz wrote: > The jobs command seems to have a problem if there is a gap in job numbers. Thanks, it was a simple off-by-one error from the last time I `improved' the job table (with a slight recount to avoid `jobs' in a subshell from crashing). The actual bug was it wouldn't report the last job in the list. However, if the table was full that was the job running `jobs', so you wouldn't notice. If the table wasn't full, the `jobs' job would go in the middle and the last one would be missing. Index: Src/jobs.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/jobs.c,v retrieving revision 1.24 diff -u -r1.24 jobs.c --- Src/jobs.c 13 Nov 2003 14:34:38 -0000 1.24 +++ Src/jobs.c 17 Feb 2004 10:36:07 -0000 @@ -1488,14 +1488,14 @@ int curmaxjob, ignorejob; if (unset(MONITOR) && oldmaxjob) { jobptr = oldjobtab; - curmaxjob = oldmaxjob; + curmaxjob = oldmaxjob ? oldmaxjob - 1 : 0; ignorejob = 0; } else { jobptr = jobtab; curmaxjob = maxjob; ignorejob = thisjob; } - for (job = 0; job != curmaxjob; job++, jobptr++) + for (job = 0; job <= curmaxjob; job++, jobptr++) if (job != ignorejob && jobptr->stat) { if ((!OPT_ISSET(ops,'r') && !OPT_ISSET(ops,'s')) || (OPT_ISSET(ops,'r') && OPT_ISSET(ops,'s')) || -- Peter Stephenson Software Engineer CSR Ltd., Science Park, Milton Road, Cambridge, CB4 0WH, UK Tel: +44 (0)1223 692070 ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **********************************************************************