summary refs log tree commit diff
path: root/posix/regex_internal.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2011-11-12 01:23:45 -0500
committerUlrich Drepper <drepper@gmail.com>2011-11-12 01:23:45 -0500
commit5e2b63c65892e054980570957f533312cfd223c2 (patch)
tree2d9ca65c8bdbd7e502101019708b8c907599a4d7 /posix/regex_internal.c
parente7f4b08ee9b36cc1fdb7d7f72013788a832a9f22 (diff)
downloadglibc-5e2b63c65892e054980570957f533312cfd223c2.tar.gz
glibc-5e2b63c65892e054980570957f533312cfd223c2.tar.xz
glibc-5e2b63c65892e054980570957f533312cfd223c2.zip
Fix warnings in regex
Diffstat (limited to 'posix/regex_internal.c')
-rw-r--r--posix/regex_internal.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/posix/regex_internal.c b/posix/regex_internal.c
index 285ae3b38e..bc1924365b 100644
--- a/posix/regex_internal.c
+++ b/posix/regex_internal.c
@@ -1,5 +1,5 @@
 /* Extended regular expression matching and search library.
-   Copyright (C) 2002-2006, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2002-2006, 2010, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
 
@@ -736,16 +736,18 @@ re_string_reconstruct (re_string_t *pstr, int idx, int eflags)
 			  unsigned char buf[6];
 			  size_t mbclen;
 
+			  const unsigned char *pp = p;
 			  if (BE (pstr->trans != NULL, 0))
 			    {
 			      int i = mlen < 6 ? mlen : 6;
 			      while (--i >= 0)
 				buf[i] = pstr->trans[p[i]];
+			      pp = buf;
 			    }
 			  /* XXX Don't use mbrtowc, we know which conversion
 			     to use (UTF-8 -> UCS4).  */
 			  memset (&cur_state, 0, sizeof (cur_state));
-			  mbclen = __mbrtowc (&wc2, (const char *) p, mlen,
+			  mbclen = __mbrtowc (&wc2, (const char *) pp, mlen,
 					      &cur_state);
 			  if (raw + offset - p <= mbclen
 			      && mbclen < (size_t) -2)