about summary refs log tree commit diff
path: root/posix
diff options
context:
space:
mode:
Diffstat (limited to 'posix')
-rw-r--r--posix/Makefile2
-rw-r--r--posix/regex.c8
2 files changed, 8 insertions, 2 deletions
diff --git a/posix/Makefile b/posix/Makefile
index daf4960d86..201cb781b7 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -52,6 +52,8 @@ routines :=								      \
 	getaddrinfo gai_strerror wordexp				      \
 	pread pwrite pread64 pwrite64
 
+include ../Makeconfig
+
 aux		:= init-posix environ
 tests		:= tstgetopt testfnm runtests wordexp-test runptests
 test-srcs	:= globtest
diff --git a/posix/regex.c b/posix/regex.c
index 62c41c11bb..484e13d799 100644
--- a/posix/regex.c
+++ b/posix/regex.c
@@ -3525,7 +3525,11 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
 
   /* If the search isn't to be a backwards one, don't waste time in a
      search for a pattern that must be anchored.  */
-  if (bufp->used > 0 && (re_opcode_t) bufp->buffer[0] == begbuf && range > 0)
+  if (bufp->used > 0 && range > 0
+      && ((re_opcode_t) bufp->buffer[0] == begbuf
+	  /* `begline' is like `begbuf' if it cannot match at newlines.  */
+	  || ((re_opcode_t) bufp->buffer[0] == begline
+	      && !bufp->newline_anchor)))
     {
       if (startpos > 0)
 	return -1;
@@ -5737,7 +5741,7 @@ weak_alias (__regexec, regexec)
    from either regcomp or regexec.   We don't use PREG here.  */
 
 size_t
-__regerror (errcode, preg, errbuf, errbuf_size)
+regerror (errcode, preg, errbuf, errbuf_size)
     int errcode;
     const regex_t *preg;
     char *errbuf;