zsh-workers
 help / color / mirror / code / Atom feed
From: Bernd Eggink <eggink@rrz.uni-hamburg.de>
To: zsh-workers <zsh-workers@math.gatech.edu>
Subject: Bugs in 3.1.2
Date: Wed, 04 Jun 1997 20:52:38 +0200	[thread overview]
Message-ID: <3395B976.2C3FDA40@rrz.uni-hamburg.de> (raw)

(I'm re-sending this because my first mail seems to have got lost).

1. There's still a minor bug in 'getopts' in 3.1.2. If the options
string contains a ':', a user supplied option ':' will be accepted.
Example:

  # tst
  while getopts ab:c opt
  do; print "option is $opt"; done
    
  tst -:        # prints 'option is :'

The easiest way to avoid this is to declare the option character ':' 
illegal. Here is a patch for "builtin.c":


2393a2394
>       lenoptstr--;
2421c2422
<     if (i == lenoptstr) {
---
>     if (i == lenoptstr || *opch == ':') {


2. 'select' still doesn't check its input correctly. As 'atoi' is used,
any string starting with a valid number is accepted. IMHO it would be
better to use 'strtol' instead and check the delimiting character. This
patch for "loop.c" does it:

123c123
<     char *str, *s;
---
>     char *str, *s, *estr;
126c126
<     int i;
---
>     long i;
172,173c172,173
<       i = atoi(str);
<       if (!i)
---
>       i = strtol(str, &estr, 10);
>       if (!i || *estr)



-- 
Bernd Eggink
Regionales Rechenzentrum der Universitaet Hamburg
eggink@rrz.uni-hamburg.de
http://www.rrz.uni-hamburg.de/eggink/BEggink.html


             reply	other threads:[~1997-06-04 18:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-06-04 18:52 Bernd Eggink [this message]
1997-06-04 19:44 ` Zoltan T. Hidvegi
1997-06-05  7:22   ` Bernd Eggink

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3395B976.2C3FDA40@rrz.uni-hamburg.de \
    --to=eggink@rrz.uni-hamburg.de \
    --cc=zsh-workers@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).