From 8d3a769e1cc6e850b882156d4bbdea68e2110877 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 10 Jun 2009 16:45:02 -0700 Subject: [PATCH] Add file missing from commit baf099 "Fix glibc 2.7 strtok_r() bug...". Oops. --- lib/string.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 lib/string.h diff --git a/lib/string.h b/lib/string.h new file mode 100644 index 000000000..9a13f0572 --- /dev/null +++ b/lib/string.h @@ -0,0 +1,18 @@ +#ifndef STRING_WRAPPER_H +#define STRING_WRAPPER_H 1 + +#include_next + +/* Glibc 2.7 has a bug in strtok_r when compiling with optimization that can + * cause segfaults if the delimiters argument is a compile-time constant that + * has exactly 1 character: + * + * http://sources.redhat.com/bugzilla/show_bug.cgi?id=5614 + * + * The bug is only present in the inline version of strtok_r(), so force the + * out-of-line version to be used instead. */ +#if HAVE_STRTOK_R_BUG +#undef strtok_r +#endif + +#endif /* string.h wrapper */ -- 2.43.0