1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

multibyte regex error handling fix

* libguile/regex-posix.c (fixup_multibyte_match): Fix mbrlen error
  handling.
This commit is contained in:
Andy Wingo 2011-01-05 16:40:22 -08:00
parent 247a56fa5a
commit f756cd3076

View file

@ -1,4 +1,4 @@
/* Copyright (C) 1997, 1998, 1999, 2000, 2001, 2004, 2006, 2007, 2010 Free Software Foundation, Inc.
/* Copyright (C) 1997, 1998, 1999, 2000, 2001, 2004, 2006, 2007, 2010, 2011 Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
@ -228,12 +228,12 @@ fixup_multibyte_match (regmatch_t *matches, int nmatches, char *str)
}
nbytes = mbrlen (str + byte_idx, MB_LEN_MAX, &state);
if (nbytes == (size_t) -2 || nbytes == (size_t) -1)
/* Something is wrong. Shouldn't be possible, as the regex match
succeeded. */
abort ();
}
if (nbytes >= (size_t) -2)
/* Something is wrong. Shouldn't be possible, as the regex match
succeeded. */
abort ();
}
#endif