I don't know how to test this functionality, but the conversion from UNIX V8 <regexp.h> to POSIX <regex.h> in patch-regex.txt cannot possibly be correct. You may want to compare the regex(3) and old regexp(3) man pages. http://svnweb.freebsd.org/base/stable/8/lib/libcompat/regexp/regexp.3?revision=196045&view=markup The most obvious problem is in translate.c, where changes like this - if (!regexec(t->attpair[a].rex, atval)) match = 0; + if (!regexec(&t->attpair[a].rex, atval, 0, NULL, 0)) match = 0; ignore that V8 regexec() and POSIX regexec() have inverted result codes. V8 regexec() returns 0 for failure, POSIX regexec() returns 0 for success. The problems in traninit.c are more subtle: - if (!(T.var_RE_value=regcomp(buf))) { + if (regcomp(&T.var_RE_value, buf, 0) != 0) { What happens in the error case? When POSIX regcomp() returns an error, the value of var_RE_value will be undefined. However, in translate.c, regexec() is blindly called with this value. Also, V8 regcomp() uses extended regular expressions. I have attached a replacement patch that reimplements the conversion from regexp to regex. It uses two simple wrapper functions that map the required V8 regcomp/regexec functionality onto POSIX regcomp/regexec. In particular, this allows us to still use (regex_t *)NULL to indicate an invalid/nonexistent regular expression. Again, I can't actually test this.
Responsible Changed From-To: freebsd-ports-bugs->kuriyama Over to maintainer (via the GNATS Auto Assign Tool)
A commit references this bug: Author: robak Date: Sat Mar 14 10:27:55 UTC 2015 New revision: 381256 URL: https://svnweb.freebsd.org/changeset/ports/381256 Log: textproc/sgmlformat: fix broken regexp -> regex conversion - Maintainer's timeout (kuriyama@FreeBSD.org) PR: 184632 Submitted by: Christian Weisgerber <naddy@FreeBSD.org> Changes: head/textproc/sgmlformat/Makefile head/textproc/sgmlformat/files/patch-regex.txt
Committed, thanks for your work!