bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Builtin read with -n0 or -N0 (nchars == 0) behaves as a read with no


From: Chet Ramey
Subject: Re: Builtin read with -n0 or -N0 (nchars == 0) behaves as a read with no -n/-N argument
Date: Wed, 7 Jun 2017 08:16:09 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.1.1

On 6/3/17 1:15 PM, Pranav Deshpande wrote:
> Hello,
> Sorry for the late reply.
> 
> My solution is to change *line 294* of builtins/read.def.
> 
> Change
> if (code == 0 || *intval < 0* || intval != (int)intval)
> 
> to
> 
> if (code == 0 || i*ntval <= 0* || intval != (int)intval)

That's a fine solution for behavior 1.  If you'd prefer behavior 2,
obviously you have to do something else. :-)

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]