Re: strfind "bug"
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: strfind "bug"
- From: Roberto Ierusalimschy <rieru@...>
- Date: 2001年12月21日 14:33:44 -0600 (CST)
On 2001年12月18日, rrthomasrr wrote:
> I just noticed that contrary to what you might expect, if you
> pass "nil" as the fourth argument of strfind, it does a plain match.
> Looking at the source, str_find indeed simply looks to see whether it
> has a fourth argument.
>
> This is rather annoying, as in some other cases where it's nice to be
> able to pass "nil" instead of omitting the argument. It would not be
> contrary to the 4.0 manual to change this behaviour (the manual says
> that if you pass 1 as the fourth arg you get a plain match).
>
> Could this be done?
Sure. We will change that for a test of trueness. That is, if you pass
a "true" value as the fourth arg you will get a plain match.
-- Roberto