> The test does _not_ fail. That if condition does return -1 on Linux
> and BSD, and making tm_to_time_t() return a failure, but the caller
> goes on, ending up with the right values in year/month/date in the
> tm struct, which is the primary thing the function is used for.
I said it wrong, test
Mike Gorchak writes:
>>> So is_date() always return negative result for the text string where
>>> date is placed before time like '2008-02-14 20:30:45'.
>> Yes, it returns this -1 on other platforms, but...
>>> It must fail on
>>> other platforms as well.
>
> It also fails under Linux, but real p
>> So is_date() always return negative result for the text string where
>> date is placed before time like '2008-02-14 20:30:45'.
> Yes, it returns this -1 on other platforms, but...
>> It must fail on
>> other platforms as well.
It also fails under Linux, but real problem is not here, it is just
Mike Gorchak writes:
> if (tm->tm_hour < 0 || tm->tm_min < 0 || tm->tm_sec < 0)
> return -1;
>
> So is_date() always return negative result for the text string where
> date is placed before time like '2008-02-14 20:30:45'.
Yes, it returns this -1 on other platforms, but...
>
> The thing that puzzles me is that nobody reported that the following
> fail on their platforms (and they do not fail for me on platforms I
> have to test in my real/virtual boxes).
Ok, check_parse calls function parse_date(), it calls
parse_date_basic(), where following code is present:
Mike Gorchak writes:
>>> Fix is_date() function failings in detection of correct date in case
>>> if time was not properly initialized.
>>
>> Please explain why this patch is needed and what problem this patch
>> is trying to fix (if any) a bit better in the proposed log message.
>> For example,
>> Fix is_date() function failings in detection of correct date in case
>> if time was not properly initialized.
>
> Please explain why this patch is needed and what problem this patch
> is trying to fix (if any) a bit better in the proposed log message.
> For example, on what input do we call this
Mike Gorchak writes:
> Fix is_date() function failings in detection of correct date in case
> if time was not properly initialized.
Please explain why this patch is needed and what problem this patch
is trying to fix (if any) a bit better in the proposed log message.
For example, on what input d
Fix is_date() function failings in detection of correct date in case
if time was not properly initialized.
From: Mike Gorchak
Signed-off-by: Mike Gorchak
---
date.c | 12 +++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/date.c b/date.c
index 57331ed..ec758f4 100644
---
9 matches
Mail list logo