+2003-06-12 H.J. Lu <hongjiu.lu@intel.com>
+
+ * posix/transbug.c (run_test): Return 1 for failure.
+ (do_test): Compare only if run_test is successful.
+
+2003-06-12 Simon Josefsson <jas@extundo.com>
+
+ * argp/argp.h [!__THROW]: Define if undefined.
+
2003-06-12 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/cris/sysdep.h: Fix handling of syscalls with
build_word_op, and build_charclass.
(build_charclass): Apply translation for character classes too.
(build_word_op): Deliver translation to build_charclass.
- * posux/transbug.c: New file.
+ * posix/transbug.c: New file.
* posix/Makefile (tests): Add transbug.
2003-06-04 Paolo Bonzini <bonzini@gnu.org>
2003-06-10 Ulrich Drepper <drepper@redhat.com>
- * inet/Makefile (aux): Add check_fd.
- * include/ifaddrs.h: Add prototype for __check_fd.
- * sysdeps/generic/check_fd.c: New file.
- * sysdeps/unix/sysv/linux/check_fd.c: New file.
+ * inet/Makefile (aux): Add check_pf.
+ * include/ifaddrs.h: Add prototype for __check_pf.
+ * sysdeps/generic/check_pf.c: New file.
+ * sysdeps/unix/sysv/linux/check_pf.c: New file.
* sysdeps/unix/sysv/linux/ifaddrs.h (__no_netlink_support): Renamed
from no_netlink_support. Export.
* sysdeps/posix/getaddrinfo.c (getaddrinfo): Don't call getifaddrs,
re_charset_t *mbcset,
int *equiv_class_alloc,
const unsigned char *name);
-static reg_errcode_t build_charclass (re_bitset_ptr_t sbcset,
+static reg_errcode_t build_charclass (RE_TRANSLATE_TYPE trans,
+ re_bitset_ptr_t sbcset,
re_charset_t *mbcset,
int *char_class_alloc,
const unsigned char *class_name,
#else /* not RE_ENABLE_I18N */
static reg_errcode_t build_equiv_class (re_bitset_ptr_t sbcset,
const unsigned char *name);
-static reg_errcode_t build_charclass (re_bitset_ptr_t sbcset,
+static reg_errcode_t build_charclass (RE_TRANSLATE_TYPE trans,
+ re_bitset_ptr_t sbcset,
const unsigned char *class_name,
reg_syntax_t syntax);
#endif /* not RE_ENABLE_I18N */
-static bin_tree_t *build_word_op (re_dfa_t *dfa, int not, reg_errcode_t *err);
+static bin_tree_t *build_word_op (re_dfa_t *dfa, RE_TRANSLATE_TYPE trans,
+ int not, reg_errcode_t *err);
static void free_bin_tree (bin_tree_t *tree);
static bin_tree_t *create_tree (bin_tree_t *left, bin_tree_t *right,
re_token_type_t type, int index);
dfa->has_mb_node = 1;
break;
case OP_WORD:
- tree = build_word_op (dfa, 0, err);
+ tree = build_word_op (dfa, regexp->trans, 0, err);
if (BE (*err != REG_NOERROR && tree == NULL, 0))
return NULL;
break;
case OP_NOTWORD:
- tree = build_word_op (dfa, 1, err);
+ tree = build_word_op (dfa, regexp->trans, 1, err);
if (BE (*err != REG_NOERROR && tree == NULL, 0))
return NULL;
break;
goto parse_bracket_exp_free_return;
break;
case CHAR_CLASS:
- *err = build_charclass (sbcset,
+ *err = build_charclass (regexp->trans, sbcset,
#ifdef RE_ENABLE_I18N
mbcset, &char_class_alloc,
#endif /* RE_ENABLE_I18N */
static reg_errcode_t
#ifdef RE_ENABLE_I18N
-build_charclass (sbcset, mbcset, char_class_alloc, class_name, syntax)
+build_charclass (trans, sbcset, mbcset, char_class_alloc, class_name, syntax)
re_charset_t *mbcset;
int *char_class_alloc;
#else /* not RE_ENABLE_I18N */
-build_charclass (sbcset, class_name, syntax)
+build_charclass (trans, sbcset, class_name, syntax)
#endif /* not RE_ENABLE_I18N */
+ RE_TRANSLATE_TYPE trans;
re_bitset_ptr_t sbcset;
const unsigned char *class_name;
reg_syntax_t syntax;
mbcset->char_classes[mbcset->nchar_classes++] = __wctype (name);
#endif /* RE_ENABLE_I18N */
-#define BUILD_CHARCLASS_LOOP(ctype_func)\
- for (i = 0; i < SBC_MAX; ++i) \
- { \
- if (ctype_func (i)) \
- bitset_set (sbcset, i); \
+#define BUILD_CHARCLASS_LOOP(ctype_func) \
+ for (i = 0; i < SBC_MAX; ++i) \
+ { \
+ if (ctype_func (i)) \
+ { \
+ int ch = trans ? trans[i] : i; \
+ bitset_set (sbcset, ch); \
+ } \
}
if (strcmp (name, "alnum") == 0)
}
static bin_tree_t *
-build_word_op (dfa, not, err)
+build_word_op (dfa, trans, not, err)
re_dfa_t *dfa;
+ RE_TRANSLATE_TYPE trans;
int not;
reg_errcode_t *err;
{
}
/* We don't care the syntax in this case. */
- ret = build_charclass (sbcset,
+ ret = build_charclass (trans, sbcset,
#ifdef RE_ENABLE_I18N
mbcset, &alloc,
#endif /* RE_ENABLE_I18N */
match it the context. */
if (constraint)
{
- if (constraint & NEXT_WORD_CONSTRAINT)
- for (j = 0; j < BITSET_UINTS; ++j)
- accepts[j] &= dfa->word_char[j];
- if (constraint & NEXT_NOTWORD_CONSTRAINT)
- for (j = 0; j < BITSET_UINTS; ++j)
- accepts[j] &= ~dfa->word_char[j];
if (constraint & NEXT_NEWLINE_CONSTRAINT)
{
int accepts_newline = bitset_contain (accepts, NEWLINE_CHAR);
else
continue;
}
+ if (constraint & NEXT_ENDBUF_CONSTRAINT)
+ {
+ bitset_empty (accepts);
+ continue;
+ }
+ if (constraint & NEXT_WORD_CONSTRAINT)
+ for (j = 0; j < BITSET_UINTS; ++j)
+ accepts[j] &= dfa->word_char[j];
+ if (constraint & NEXT_NOTWORD_CONSTRAINT)
+ for (j = 0; j < BITSET_UINTS; ++j)
+ accepts[j] &= ~dfa->word_char[j];
}
/* Then divide `accepts' into DFA states, or create a new
printf ("search 2: res = %d, start = %d, end = %d\n",
res, regs[1].start[0], regs[1].end[0]);
- return 0;
+ return res < 0 ? 1 : 0;
}
(void) re_set_syntax (RE_SYNTAX_GNU_AWK);
- run_test (lower, regs);
- run_test (upper, ®s[2]);
-
- int result = 0;
+ int result;
#define CHECK(exp) \
if (exp) { puts (#exp); result = 1; }
- CHECK (regs[0].start[0] != regs[2].start[0]);
- CHECK (regs[0].end[0] != regs[2].end[0]);
- CHECK (regs[1].start[0] != regs[3].start[0]);
- CHECK (regs[1].end[0] != regs[3].end[0]);
+ result = run_test (lower, regs);
+ result |= run_test (upper, ®s[2]);
+ if (! result)
+ {
+ CHECK (regs[0].start[0] != regs[2].start[0]);
+ CHECK (regs[0].end[0] != regs[2].end[0]);
+ CHECK (regs[1].start[0] != regs[3].start[0]);
+ CHECK (regs[1].end[0] != regs[3].end[0]);
+ }
return result;
}