Hi all,
I've been citing this a few times already, but got no answer,
yet it looks wrong.
3rd logical parameter is used to decide about hb_regex() mode:
---
/* Returns just .T. if match found or .F. otherwise. */
HB_FUNC( HB_REGEXMATCH )
{
hb_retl( hb_regex( hb_parl( 3 ) ? 1 /* LIKE */ : 2 /* HAS */ ) ); /* !!
PARAM #3 !! */
}
---
Then hb_regex() is called, which contains this code:
---
pRegEx = hb_regexGet( hb_param( 1, HB_IT_ANY ),
( ISLOG( 3 ) && !hb_parl( 3 ) ? HBREG_ICASE : 0 ) |
/* !! PARAM #3 !! */
( hb_parl( 4 ) ? HBREG_NEWLINE : 0 ) );
---
I don't use this function, but this seems clearly wrong (came
from xhb), so IMO it should be fixed. Documentation says that
3rd parameter controls case sensitivity.
Depending on the 3rd parameter, HB_REGEXMATCH() is a
synonym to HB_REGEXHAS() and HB_REGEXLIKE(), so it
doesn't give any extra functionality.
Suggestions for fix:
1.) Move it to xhb.lib with this bug intact.
2.) Fix it by using hb_parl( 5 ) in HB_REGEXMATCH().
This will make it in sync with the documentation, but
can break apps, relying on odd behaviour.
(my vote for 2.)
Opinions?
Brgds,
Viktor
_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour