* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-
+#include <glib.h>
#include "string_match.h"
regex_t re;
int problem;
+ g_return_val_if_fail(txt, 0);
+ g_return_val_if_fail(rexp, 0);
+
problem = regcomp(&re, rexp, cflags);
if (problem == 0) {
problem = regexec(&re, txt, size, matches, eflags);
regmatch_t matches[STRING_MATCH_MR_SIZE];
int foundp;
+ g_return_val_if_fail(txt, -1);
+ g_return_val_if_fail(rexp, -1);
+
if (strlen(txt) > 0 && strlen(rexp) > 0) {
foundp = string_match_regexp(txt, rexp, STRING_MATCH_MR_SIZE,
matches, cflags, eflags);
int pos = 0;
int pos0 = pos;
+ g_return_val_if_fail(txt, 0);
+ g_return_val_if_fail(rexp, 0);
+
while (pos0 >= 0 && pos < strlen(txt) && strlen(txt) > 0) {
/* printf("%s %d:%d\n", txt, pos0, pos); */
pos0 = string_remove_match(txt + pos, rexp, cflags, eflags);