summary refs log tree commit diff
path: root/posix
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2002-12-13 23:45:19 +0000
committerRoland McGrath <roland@gnu.org>2002-12-13 23:45:19 +0000
commita075623112f96ed39fe027faf01fbffc62ca7ca3 (patch)
tree9f0ad472978fd807b05e9fd2a21a39f2949d1735 /posix
parent3b7c07d8f2a4ab7317a630c3240e2fc5f5d4e681 (diff)
downloadglibc-a075623112f96ed39fe027faf01fbffc62ca7ca3.tar.gz
glibc-a075623112f96ed39fe027faf01fbffc62ca7ca3.tar.xz
glibc-a075623112f96ed39fe027faf01fbffc62ca7ca3.zip
2002-12-14 Jakub Jelinek <jakub@redhat.com>
	* posix/regex_internal.c (re_string_context_at): Guard wide char
	code with #ifdef RE_ENABLE_I18N.
Diffstat (limited to 'posix')
-rw-r--r--posix/regex_internal.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/posix/regex_internal.c b/posix/regex_internal.c
index 835406c60c..a9559e2768 100644
--- a/posix/regex_internal.c
+++ b/posix/regex_internal.c
@@ -562,14 +562,8 @@ re_string_context_at (input, idx, eflags, newline_anchor)
 	return ((eflags & REG_NOTEOL) ? CONTEXT_ENDBUF
 		: CONTEXT_NEWLINE | CONTEXT_ENDBUF);
     }
-  if (MB_CUR_MAX == 1)
-    {
-      c = re_string_byte_at (input, idx);
-      if (IS_WORD_CHAR (c))
-	return CONTEXT_WORD;
-      return (newline_anchor && IS_NEWLINE (c)) ? CONTEXT_NEWLINE : 0;
-    }
-  else
+#ifdef RE_ENABLE_I18N
+  if (MB_CUR_MAX > 1)
     {
       wint_t wc;
       int wc_idx = idx;
@@ -588,6 +582,14 @@ re_string_context_at (input, idx, eflags, newline_anchor)
 	return CONTEXT_WORD;
       return (newline_anchor && IS_WIDE_NEWLINE (wc)) ? CONTEXT_NEWLINE : 0;
     }
+  else
+#endif
+    {
+      c = re_string_byte_at (input, idx);
+      if (IS_WORD_CHAR (c))
+	return CONTEXT_WORD;
+      return (newline_anchor && IS_NEWLINE (c)) ? CONTEXT_NEWLINE : 0;
+    }
 }
 
 /* Functions for set operation.  */