[PATCH v2] Makefile.am: fix regular expression not tolerate extra whitespace

JingPiao Chen chenjingpiao at gmail.com
Thu Jan 19 06:59:51 UTC 2017


If have whitespace between pound and include, or more than one
whitespace between include and DEF_MPERS_TYPE, the regular
expression will not match.

* Makefile.am (m%_type_defs.h): Fix regular expression.
---
 Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index afc3dd2..8de3aa0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -880,7 +880,7 @@ mpers-m%.stamp: $(srcdir_mpers_source_files) | printers.h
 
 m%_type_defs.h: $(srcdir_mpers_source_files)
 	for f in $^; do \
-		sed -r -n 's/^#include DEF_MPERS_TYPE\(([^)]+)\)/#ifdef MPERS_$(mpers_PREFIX)\1\n# define \1 MPERS_$(mpers_PREFIX)\1\n#endif/p' $$f || exit; \
+		sed -r -n 's/^#[[:space:]]*include[[:space:]]+DEF_MPERS_TYPE\(([^)]+)\)/#ifdef MPERS_$(mpers_PREFIX)\1\n# define \1 MPERS_$(mpers_PREFIX)\1\n#endif/p' $$f || exit; \
 	done > $@-t
 	echo '#undef MPERS_PRINTER_NAME' >> $@-t
 	echo '#define MPERS_PRINTER_NAME(printer_name) printer_name' >> $@-t
-- 
1.9.1





More information about the Strace-devel mailing list