about summary refs log tree commit diff
path: root/posix
diff options
context:
space:
mode:
Diffstat (limited to 'posix')
-rw-r--r--posix/regex.c6
-rw-r--r--posix/regex.h2
-rw-r--r--posix/regex_internal.h3
3 files changed, 8 insertions, 3 deletions
diff --git a/posix/regex.c b/posix/regex.c
index 4c3826238b..7a4f304cdd 100644
--- a/posix/regex.c
+++ b/posix/regex.c
@@ -74,6 +74,12 @@
 /* POSIX says that <sys/types.h> must be included (by the caller) before
    <regex.h>.  */
 #include <sys/types.h>
+
+/* On some systems, limits.h sets RE_DUP_MAX to a lower value than
+   GNU regex allows.  Include it before <regex.h>, which correctly
+   #undefs RE_DUP_MAX and sets it to the right value.  */
+#include <limits.h>
+
 #include <regex.h>
 #include "regex_internal.h"
 
diff --git a/posix/regex.h b/posix/regex.h
index c76005332d..b4a975b48b 100644
--- a/posix/regex.h
+++ b/posix/regex.h
@@ -313,7 +313,7 @@ typedef enum
   /* POSIX regcomp return error codes.  (In the order listed in the
      standard.)  */
   REG_BADPAT,		/* Invalid pattern.  */
-  REG_ECOLLATE,		/* Not implemented.  */
+  REG_ECOLLATE,		/* Inalid collating element.  */
   REG_ECTYPE,		/* Invalid character class name.  */
   REG_EESCAPE,		/* Trailing backslash.  */
   REG_ESUBREG,		/* Invalid back reference.  */
diff --git a/posix/regex_internal.h b/posix/regex_internal.h
index 7a7d964bd5..7ec7294692 100644
--- a/posix/regex_internal.h
+++ b/posix/regex_internal.h
@@ -23,7 +23,6 @@
 
 #include <assert.h>
 #include <ctype.h>
-#include <limits.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -53,7 +52,7 @@
 #endif
 
 /* This is for other GNU distributions with internationalized messages.  */
-#if HAVE_LIBINTL_H || defined _LIBC
+#if (HAVE_LIBINTL_H && ENABLE_NLS) || defined _LIBC
 # include <libintl.h>
 # ifdef _LIBC
 #  undef gettext