[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

grep branch, master, updated. v2.10-7-gf3d95e9

From: Jim Meyering
Subject: grep branch, master, updated. v2.10-7-gf3d95e9
Date: Mon, 21 Nov 2011 19:32:24 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grep".

The branch, master has been updated
       via  f3d95e96a371111f8b9b4941f1075933c904142a (commit)
      from  cb6fe0ad60076c747d4d752e52fc00b6263f34fd (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------

commit f3d95e96a371111f8b9b4941f1075933c904142a
Author: Jim Meyering <address@hidden>
Date:   Mon Nov 21 18:38:17 2011 +0100

    portability: work consistently on *BSD systems
    * src/dfa.c (is_valid_unibyte_character): Define.
    (IS_WORD_CONSTITUENT): Use it here, to make grep work consistently
    even on *BSD systems, which use different tables for ctype macros
    like isalpha.
    With help from Bruno Haible.

diff --git a/src/dfa.c b/src/dfa.c
index e28726d..9e7c136 100644
--- a/src/dfa.c
+++ b/src/dfa.c
@@ -1071,8 +1071,18 @@ parse_bracket_exp (void)
   return CSET + charclass_index(ccl);
+/* Add this to the test for whether a byte is word-constituent, since on
+   BSD-based systems, many values in the 128..255 range are classified as
+   alphabetic, while on glibc-based systems, they are not.  */
+#ifdef __GLIBC__
+# define is_valid_unibyte_character(c) 1
+# define is_valid_unibyte_character(c) (MBS_SUPPORT && btowc (c) != WEOF)
 /* Return non-zero if C is a `word-constituent' byte; zero otherwise.  */
-#define IS_WORD_CONSTITUENT(C) (isalnum(C) || (C) == '_')
+  (is_valid_unibyte_character(C) && (isalnum(C) || (C) == '_'))
 static token
 lex (void)


Summary of changes:
 src/dfa.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]