--- libelwix/src/regex.c 2015/06/25 00:36:48 1.2.20.1 +++ libelwix/src/regex.c 2024/10/28 09:58:51 1.4 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: regex.c,v 1.2.20.1 2015/06/25 00:36:48 misho Exp $ +* $Id: regex.c,v 1.4 2024/10/28 09:58:51 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -12,7 +12,7 @@ terms: All of the documentation and software included in the ELWIX and AITNET Releases is copyrighted by ELWIX - Sofia/Bulgaria -Copyright 2004 - 2015 +Copyright 2004 - 2024 by Michael Pounov . All rights reserved. Redistribution and use in source and binary forms, with or without @@ -61,7 +61,7 @@ regex_Verify(const char *csRegex, const char *csData, regex_t re; regmatch_t match; char szErr[STRSIZ]; - int ret, flg; + int ret = 0, flg; const char *pos; if (!csRegex || !csData) @@ -74,7 +74,7 @@ regex_Verify(const char *csRegex, const char *csData, return NULL; } - for (ret = flg = 0, pos = csData; !(ret = regexec(&re, pos, 1, &match, flg)); + for (flg = 0, pos = csData; !(ret = regexec(&re, pos, 1, &match, flg)); pos += match.rm_eo, flg = REG_NOTBOL) { if (startPos) *startPos = match.rm_so;