[pcre-dev] [Bug 565] Not an empty string with pcre_copy_nam…

Kezdőlap
Üzenet törlése
Szerző: Philip Hazel
Dátum:  
Címzett: pcre-dev
Tárgy: [pcre-dev] [Bug 565] Not an empty string with pcre_copy_named_substring for unmatched duplicate names
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=565




--- Comment #3 from Philip Hazel <ph10@???> 2007-08-01 16:49:46 ---
(In reply to comment #1)
> I forgot to mention, the bug_report function printed the following on my
> system:
>
> Return value is -7, value of field is: [ERR]
>
> Whereas I would have expected either one of:
>
> Return value is -7, value of field is: []
> Return value is 0, value of field is: []


I know you don't want to hear this, but I've now thought about this, and my
view is that the documentation is what is wrong, rather than the code. When the
return value is not zero, I don't think it should touch the output data fields.
I was considering not only this case, but also the number case where, suppose,
you asked for the contents of a substring by number. In your example program,
the return value from the exec is 1, showing no captured substrings. Asking for
field 1 in this case would get the same error. The only alternative approach
would be always to set up an empty string in the case of error, and I do not
feel comfortable with this. So I plan to update the specification.


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email