summaryrefslogtreecommitdiff
path: root/libguile/regex-posix.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2011-01-05 16:40:22 -0800
committerAndy Wingo <wingo@pobox.com>2011-01-07 09:18:36 -0800
commitf756cd30764c76d270cc34969d7156ebcfcfb214 (patch)
treec7ed9563893fb2828c40e140ef032e173f74936e /libguile/regex-posix.c
parent247a56fa5a00e3e2c373ab30762bd119fc250a07 (diff)
downloadguile-f756cd30764c76d270cc34969d7156ebcfcfb214.tar.gz
multibyte regex error handling fix
* libguile/regex-posix.c (fixup_multibyte_match): Fix mbrlen error handling.
Diffstat (limited to 'libguile/regex-posix.c')
-rw-r--r--libguile/regex-posix.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libguile/regex-posix.c b/libguile/regex-posix.c
index 4c0357744..34230994e 100644
--- a/libguile/regex-posix.c
+++ b/libguile/regex-posix.c
@@ -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