[PATCH] some regex patches

Isamu Hasegawa isamu@yamato.ibm.com
Fri Feb 28 14:30:00 GMT 2003


Hello,

Attached patches are feedback from gawk developers.
These fixes are prepared in last year, I'm sorry to send them after
such a long time...

Descriptions are followed:

patch.030228.transbug:
This patch fixes the bug which causes incorrect behavior when both of
character class and translate are used.  Test case is "regextest.c".

$ ./regextest
search 1: res = 4, start = 4, end = 8
search 2: res = 12, start = 12, end = 16

$ ./a.out -u
search 1: res = -1
search 2: res = -1

Both case must return same result, but the latter case (using translate)
failed.  Changelog entry is the followed:

2003-2-28  Isamu Hasegawa  <isamu@yamato.ibm.com>

	* posix/regcomp.c (parse_expression): Deliver translation to
	build_word_op, and build_charclass.
	(build_charclass): Apply translation for character classes too.
	(build_word_op): Deliver translation to build_charclass.


patch.030228.prototype:
This patch just wrap all the function declarations in _RE_ARGS to let
K&R compilers compile regex.

2003-2-28  Isamu Hasegawa  <isamu@yamato.ibm.com>

	* posix/regcomp.c: Wrap all the function declarations in _RE_ARGS.
	* posix/regex_internal.c: Likewise.
	* posix/regex_internal.h: Likewise.
	* posix/regexec.c: Likewise.


patch.030228.misc:
This patch contains some minor fixes requested from gawk developers.
They have no effect in case of using inside glibc.  They are for K&R
compilers and Mac OS X compiler.

2003-2-28  Isamu Hasegawa  <isamu@yamato.ibm.com>

	* posix/regcomp.c (parse_reg_exp): Split out variable declarations
	from assignment.
	* posix/regex.h: Define __restrict in case of Apple CC.
	* posix/regex_internal.h: Append ENABLE_NLS for the condition of
	including libintl.h.
	* posix/regexec.c (set_regs): Split out a structure declaration from
	assignment.

Thanks,
--
Isamu Hasegawa
IBM Japan, Ltd.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: patches.tar.gz
Type: application/octet-stream
Size: 8923 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20030228/9fa0aa02/attachment.obj>


More information about the Libc-alpha mailing list