diff ifndef_wrapper.sh @ 1611:0196f4f83fee

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	Fri Mar 09 23:16:37 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/'