+int
+match_no_newline(
+ const char * regex,
+ const char * str)
+{
+ regex_t regc;
+ int result;
+ char errmsg[STR_SIZE];
+
+ if((result = regcomp(®c, regex,
+ REG_EXTENDED|REG_NOSUB)) != 0) {
+ regerror(result, ®c, errmsg, SIZEOF(errmsg));
+ error(_("regex \"%s\": %s"), regex, errmsg);
+ /*NOTREACHED*/
+ }
+
+ if((result = regexec(®c, str, 0, 0, 0)) != 0
+ && result != REG_NOMATCH) {
+ regerror(result, ®c, errmsg, SIZEOF(errmsg));
+ error(_("regex \"%s\": %s"), regex, errmsg);
+ /*NOTREACHED*/
+ }
+
+ regfree(®c);
+
+ return result == 0;
+}
+