aboutsummaryrefslogtreecommitdiff
path: root/posix/regcomp.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-02-21 01:52:32 +0000
committerUlrich Drepper <drepper@redhat.com>2003-02-21 01:52:32 +0000
commit54e1cabce616d89ad657731531620b7cd88fb8e2 (patch)
treef4b2384540f7f7d7314d76b6ff08a98a76205117 /posix/regcomp.c
parent6eb74f33650b4b55e8bc7679145e9293c4b43f2f (diff)
downloadglibc-54e1cabce616d89ad657731531620b7cd88fb8e2.tar
glibc-54e1cabce616d89ad657731531620b7cd88fb8e2.tar.gz
glibc-54e1cabce616d89ad657731531620b7cd88fb8e2.tar.bz2
glibc-54e1cabce616d89ad657731531620b7cd88fb8e2.zip
Update.
* inet/rcmd.c (rresvport_af): Avoid using invliad values. Wrap around in search if port IPPORT_RESERVED/2 has been test. 2002-02-20 Paolo Bonzini <bonzini@gnu.org> * posix/regcomp.c: Remove inclusions. * posix/regexec.c: Likewise. * posix/regex_internal.c: Likewise. * posix/regex_internal.h: Add inclusions here. * posix/regex.c: Only include sys/types.h before regex.h. Include regex_internal.h here. Include regex_internal.c before regcomp.c and regexec.c (might expose more opportunities to the C compiler). * posix/regcomp.c (parse_expression): Fix construct rejected by SGI CC. * posix/regex_internal.h [!_LIBC] (__mempcpy): Fix typo. [!_LIBC] (__wcrtomb): New definition. [!_LIBC]: Conditionalize enabling of I18N on HAVE_WCSCOLL and HAVE_LOCALE_H as well. 2003-02-20 Ulrich Drepper <drepper@redhat.com>
Diffstat (limited to 'posix/regcomp.c')
-rw-r--r--posix/regcomp.c60
1 files changed, 8 insertions, 52 deletions
diff --git a/posix/regcomp.c b/posix/regcomp.c
index e36383b92d..f25ecae5fd 100644
--- a/posix/regcomp.c
+++ b/posix/regcomp.c
@@ -18,56 +18,6 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#include <assert.h>
-#include <ctype.h>
-#include <limits.h>
-#include <locale.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#if defined HAVE_WCHAR_H || defined _LIBC
-# include <wchar.h>
-#endif /* HAVE_WCHAR_H || _LIBC */
-#if defined HAVE_WCTYPE_H || defined _LIBC
-# include <wctype.h>
-#endif /* HAVE_WCTYPE_H || _LIBC */
-
-/* In case that the system doesn't have isblank(). */
-#if !defined _LIBC && !defined HAVE_ISBLANK && !defined isblank
-# define isblank(ch) ((ch) == ' ' || (ch) == '\t')
-#endif
-
-#ifdef _LIBC
-# ifndef _RE_DEFINE_LOCALE_FUNCTIONS
-# define _RE_DEFINE_LOCALE_FUNCTIONS 1
-# include <locale/localeinfo.h>
-# include <locale/elem-hash.h>
-# include <locale/coll-lookup.h>
-# endif
-#endif
-
-/* This is for other GNU distributions with internationalized messages. */
-#if HAVE_LIBINTL_H || defined _LIBC
-# include <libintl.h>
-# ifdef _LIBC
-# undef gettext
-# define gettext(msgid) \
- INTUSE(__dcgettext) (INTUSE(_libc_intl_domainname), msgid, LC_MESSAGES)
-# endif
-#else
-# define gettext(msgid) (msgid)
-#endif
-
-#ifndef gettext_noop
-/* This define is so xgettext can find the internationalizable
- strings. */
-# define gettext_noop(String) String
-#endif
-
-#include <regex.h>
-#include "regex_internal.h"
-
static reg_errcode_t re_compile_internal (regex_t *preg, const char * pattern,
int length, reg_syntax_t syntax);
static void re_compile_fastmap_iter (regex_t *bufp,
@@ -1995,7 +1945,10 @@ parse_expression (regexp, preg, token, syntax, nest, err)
mbc_remain = create_tree (NULL, NULL, 0, new_idx);
tree = create_tree (tree, mbc_remain, CONCAT, 0);
if (BE (new_idx == -1 || mbc_remain == NULL || tree == NULL, 0))
- return *err = REG_ESPACE, NULL;
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
}
}
#endif
@@ -2097,7 +2050,10 @@ parse_expression (regexp, preg, token, syntax, nest, err)
new_idx = re_dfa_add_node (dfa, *token, 0);
tree = create_tree (NULL, NULL, 0, new_idx);
if (BE (new_idx == -1 || tree == NULL, 0))
- return *err = REG_ESPACE, NULL;
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
}
/* We must return here, since ANCHORs can't be followed
by repetition operators.