aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2020-10-28 16:48:14 -0700
committerRob Landley <rob@landley.net>2020-10-29 06:10:03 -0500
commitaed6c26fe4792e19f8ad99bef058f690fc2deecf (patch)
treeaea0321e6493986ffdb3d79e1ab018293aae1b2d /lib
parent7b0ea0a21fb2d97c7bd24987f8ccf27548c0b004 (diff)
downloadtoybox-aed6c26fe4792e19f8ad99bef058f690fc2deecf.tar.gz
Make it easier to switch regex implementations.
One reason to use toybox on the host is to get the same behavior across Android/Linux/macOS. Unfortunately (as we've seen from a few bugs) one area where that doesn't quite work is that toybox uses the libc regular expression implementation. That's fine, and mostly what users want, but those folks trying to get the exact same behavior everywhere might want to switch in a known regex implementation (bionic's NetBSD regex implementation, say) for increased consistency. That actually works pretty well, but portability.h has an #ifndef test for REG_STARTEND before including <regex.h> that gets in the way. To make up for that, this patch removes the unnecessary #include <regex.h> from grep.c itself.
Diffstat (limited to 'lib')
-rw-r--r--lib/portability.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/portability.h b/lib/portability.h
index acc32fd4..05a449ee 100644
--- a/lib/portability.h
+++ b/lib/portability.h
@@ -6,6 +6,7 @@
// For musl
#define _ALL_SOURCE
+#include <regex.h>
#ifndef REG_STARTEND
#define REG_STARTEND 0
#endif