summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDJ Delorie <dj@delorie.com>2001-07-19 00:04:29 +0000
committerDJ Delorie <dj@delorie.com>2001-07-19 00:04:29 +0000
commit740a8283a03d9b901f5a03f21da97da7ae369fc6 (patch)
tree50072d82c40859456029ca417037215ac7dc44e2
parent4833f5f83426b0eb03a31fa13b95330ad6831cf0 (diff)
downloadbinutils-redhat-740a8283a03d9b901f5a03f21da97da7ae369fc6.tar.gz
merge from gcc
-rw-r--r--include/ChangeLog4
-rw-r--r--include/xregex2.h17
-rw-r--r--libiberty/ChangeLog14
-rw-r--r--libiberty/regex.c34
4 files changed, 50 insertions, 19 deletions
diff --git a/include/ChangeLog b/include/ChangeLog
index 8103bd5f74..0dc6acd04d 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,7 @@
+2001-07-18 Andreas Jaeger <aj@suse.de>
+
+ * xregex2.h: Place under LGPL version 2.1.
+
2001-07-12 Jeff Johnston <jjohnstn@redhat.com>
* opcode/cgen.h (CGEN_INSN): Add regex support.
diff --git a/include/xregex2.h b/include/xregex2.h
index 63c2fef696..b9c2d97cce 100644
--- a/include/xregex2.h
+++ b/include/xregex2.h
@@ -1,24 +1,23 @@
/* Definitions for data structures and routines for the regular
expression library, version 0.12.
Copyright (C) 1985,1989-1993,1995-1998, 2000 Free Software Foundation, Inc.
-
This file is part of the GNU C Library. Its master source is NOT part of
the C library, however. The master source lives in /gd/gnu/lib.
The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
+ Lesser General Public License for more details.
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
#ifndef _REGEX_H
#define _REGEX_H 1
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 93156598ee..e3e8614d1c 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,17 @@
+2001-07-18 Andreas Schwab <schwab@suse.de>
+
+ * regex.c (WORDCHAR_P) [WCHAR]: Also return true for the
+ underscore character.
+
+2001-07-18 Ulrich Drepper <drepper@redhat.com>
+
+ * regex.c: Limit string length printed in debug messages to 100
+ chars.
+
+2001-07-18 Andreas Jaeger <aj@suse.de>
+
+ * regex.c: Place under LGPL version 2.1.
+
2001-07-10 Jeff Johnston <jjohnstn@redhat.com>
* Makefile.in: Add support for regex code.
diff --git a/libiberty/regex.c b/libiberty/regex.c
index 642dc05f1f..f067752379 100644
--- a/libiberty/regex.c
+++ b/libiberty/regex.c
@@ -3,26 +3,28 @@
(Implements POSIX draft P1003.2/D11.2, except for some of the
internationalization features.)
Copyright (C) 1993-1999, 2000, 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
+ Lesser General Public License for more details.
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
/* This file has been modified for usage in libiberty. It includes "xregex.h"
instead of <regex.h>. The "xregex.h" header file renames all external
routines with an "x" prefix so they do not collide with the native regex
routines or with other components regex routines. */
+/* AIX requires this to be the first thing in the file. */
#if defined _AIX && !defined REGEX_MALLOC
#pragma alloca
#endif
@@ -1184,6 +1186,8 @@ PREFIX(print_double_string) (where, string1, size1, string2, size2)
printf ("(null)");
else
{
+ int cnt;
+
if (FIRST_STRING_P (where))
{
for (this_char = where - string1; this_char < size1; this_char++)
@@ -1192,8 +1196,16 @@ PREFIX(print_double_string) (where, string1, size1, string2, size2)
where = string2;
}
+ cnt = 0;
for (this_char = where - string2; this_char < size2; this_char++)
- PUT_CHAR (string2[this_char]);
+ {
+ PUT_CHAR (string2[this_char]);
+ if (++cnt > 100)
+ {
+ fputs ("...", stdout);
+ break;
+ }
+ }
}
}
@@ -5339,7 +5351,9 @@ PREFIX(re_search_2) (bufp, string1, size1, string2, size2, startpos, range,
/* Use internationalized API instead of SYNTAX. */
# define WORDCHAR_P(d) \
(iswalnum ((wint_t)((d) == end1 ? *string2 \
- : (d) == string2 - 1 ? *(end1 - 1) : *(d))) != 0)
+ : (d) == string2 - 1 ? *(end1 - 1) : *(d))) != 0 \
+ || ((d) == end1 ? *string2 \
+ : (d) == string2 - 1 ? *(end1 - 1) : *(d)) == L'_')
#else /* BYTE */
# define WORDCHAR_P(d) \
(SYNTAX ((d) == end1 ? *string2 \