diff ifndef_wrapper.sh @ 1612:470aa609c7e4

avoid extended regex features to avoid caring about sed -r vs -E
author Matt Johnston <matt@ucc.asn.au>
date Tue, 24 Jul 2018 20:19:05 +0800
parents 198e2ee0f4b1
children
line wrap: on
line diff
--- a/ifndef_wrapper.sh	Tue Feb 27 22:21:48 2018 +0800
+++ b/ifndef_wrapper.sh	Tue Jul 24 20:19:05 2018 +0800
@@ -2,6 +2,6 @@
 
 # Wrap all "#define X Y" with a #ifndef X...#endif"
 
-sed -E 's/^( *#define ([^ ]+) .*)/#ifndef \2\
+sed 's/^\( *#define \([^ ][^ ]*\) .*\)/#ifndef \2\
 \1\
 #endif/'