From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3408 invoked by alias); 21 May 2012 18:39:52 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 30485 Received: (qmail 16378 invoked from network); 21 May 2012 18:39:40 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DOS_RCVD_IP_TWICE_B, SPF_HELO_PASS autolearn=ham version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at lorien.comfychair.org designates 173.8.144.98 as permitted sender) Date: Mon, 21 May 2012 11:29:51 -0700 From: Danek Duvall To: zsh-workers@zsh.org Subject: patch for kill builtin Message-ID: <20120521182951.GA10763@lorien.comfychair.org> Mail-Followup-To: Danek Duvall , zsh-workers@zsh.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2010-04-22) We had a bug report saying that "kill -9hello " simply killed with SIGKILL, rather than reporting that "9hello" wasn't a proper signal name like bash and ksh do. Since there's already code later on in bin_kill() that recognizes this situation when you use -n, it was pretty straightforward to copy the the code where - was handled. --- zsh-4.3.17/Src/jobs.c Sat Dec 10 14:40:56 2011 +++ zsh-4.3.17/Src/jobs.c Sat May 19 23:24:16 2012 @@ -2157,9 +2157,15 @@ /* check for, and interpret, a signal specifier */ if (*argv && **argv == '-') { - if (idigit((*argv)[1])) + if (idigit((*argv)[1])) { + char *endp; /* signal specified by number */ - sig = atoi(*argv + 1); + sig = zstrtol(*argv + 1, &endp, 10); + if (*endp) { + zwarnnam(nam, "invalid signal number: %s", *argv); + return 1; + } + } else if ((*argv)[1] != '-' || (*argv)[2]) { char *signame; Thanks, Danek