View | Details | Raw Unified | Return to bug 18681 | Differences between
and this patch

Collapse All | Expand All

(-)a/NEWS (+6 lines)
Lines 71-76 Version 2.22 Link Here
71
  compliance. The new implementation fixes the following long-standing
71
  compliance. The new implementation fixes the following long-standing
72
  issues: BZ#6544, BZ#11216, BZ#12836, BZ#13151, BZ#13152, and BZ#14292. The
72
  issues: BZ#6544, BZ#11216, BZ#12836, BZ#13151, BZ#13152, and BZ#14292. The
73
  old implementation is still present for use be by existing binaries.
73
  old implementation is still present for use be by existing binaries.
74
75
* The header <regexp.h> is deprecated, and will be removed in a future
76
  release.  (It was removed from POSIX long ago, and it has bugs we cannot
77
  easily fix.  See BZ#18681 for more details.)  We suspect that no one has
78
  used this header in many years, but if you have code that does use it,
79
  you will need to update it to use <regex.h> instead.
74
80
75
Version 2.21
81
Version 2.21
76
82
(-)a/misc/regexp.c (-4 / +4 lines)
Lines 17-24 Link Here
17
   License along with the GNU C Library; if not, see
17
   License along with the GNU C Library; if not, see
18
   <http://www.gnu.org/licenses/>.  */
18
   <http://www.gnu.org/licenses/>.  */
19
19
20
#define __DO_NOT_DEFINE_COMPILE
20
/* We don't include regexp.h here because of the macros it requires, and
21
#include <regexp.h>
21
   because it now contains an unconditional #warning. */
22
23
#include <regex.h>
22
24
23
/* Define the variables used for the interface.  */
25
/* Define the variables used for the interface.  */
24
char *loc1;
26
char *loc1;
Lines 32-38 char *locs; Link Here
32
   found in the buffer starting at EXPBUF.  `loc1' will return the
34
   found in the buffer starting at EXPBUF.  `loc1' will return the
33
   first character matched and `loc2' points to the next unmatched
35
   first character matched and `loc2' points to the next unmatched
34
   character.  */
36
   character.  */
35
extern int __step (const char *string, const char *expbuf);
36
int
37
int
37
__step (const char *string, const char *expbuf)
38
__step (const char *string, const char *expbuf)
38
{
39
{
Lines 55-61 weak_alias (__step, step) Link Here
55
/* Match the beginning of STRING with the compiled regular expression
56
/* Match the beginning of STRING with the compiled regular expression
56
   in EXPBUF.  If the match is successful `loc2' will contain the
57
   in EXPBUF.  If the match is successful `loc2' will contain the
57
   position of the first unmatched character.  */
58
   position of the first unmatched character.  */
58
extern int __advance (const char *string, const char *expbuf);
59
int
59
int
60
__advance (const char *string, const char *expbuf)
60
__advance (const char *string, const char *expbuf)
61
{
61
{
(-)a/misc/regexp.h (-14 / +17 lines)
Lines 19-32 Link Here
19
#ifndef _REGEXP_H
19
#ifndef _REGEXP_H
20
#define _REGEXP_H	1
20
#define _REGEXP_H	1
21
21
22
/* The contents of this header file was first standardized in X/Open
22
/* The contents of this header file were first standardized in X/Open
23
   System Interface and Headers Issue 2, originally coming from SysV.
23
   System Interface and Headers Issue 2, originally coming from SysV.
24
   In issue 4, version 2, it is marked as TO BE WITDRAWN, and it has
24
   In issue 4, version 2, it was marked as TO BE WITHDRAWN, and it was
25
   been withdrawn in SUSv3.
25
   duly withdrawn in issue 6.
26
26
27
   This code shouldn't be used in any newly written code.  It is
27
   This header is provided only for backward compatibility, and it will
28
   included only for compatibility reasons.  Use the POSIX definition
28
   be removed in the next release of GNU libc.  New code should use
29
   in <regex.h> for portable applications and a reasonable interface.  */
29
   <regex.h> instead.  */
30
31
#warning "regexp.h is obsolete and buggy."
32
#warning "It will be removed in the next release of GNU libc."
33
#warning "Please update your code to use regex.h instead (no trailing 'p')."
30
34
31
#include <features.h>
35
#include <features.h>
32
#include <alloca.h>
36
#include <alloca.h>
Lines 182-200 compile (char *__restrict instring, char *__restrict expbuf, Link Here
182
      case REG_ERPAREN:
186
      case REG_ERPAREN:
183
      default:
187
      default:
184
	/* There is no matching error code.  */
188
	/* There is no matching error code.  */
185
	RETURN (36);
189
	ERROR (36);
186
      case REG_ESUBREG:
190
      case REG_ESUBREG:
187
	RETURN (25);
191
	ERROR (25);
188
      case REG_EBRACK:
192
      case REG_EBRACK:
189
	RETURN (49);
193
	ERROR (49);
190
      case REG_EPAREN:
194
      case REG_EPAREN:
191
	RETURN (42);
195
	ERROR (42);
192
      case REG_EBRACE:
196
      case REG_EBRACE:
193
	RETURN (44);
197
	ERROR (44);
194
      case REG_BADBR:
198
      case REG_BADBR:
195
	RETURN (46);
199
	ERROR (46);
196
      case REG_ERANGE:
200
      case REG_ERANGE:
197
	RETURN (11);
201
	ERROR (11);
198
      case REG_ESPACE:
202
      case REG_ESPACE:
199
      case REG_ESIZE:
203
      case REG_ESIZE:
200
	ERROR (50);
204
	ERROR (50);
201
- 

Return to bug 18681