From d524bf0ee69aa468a4714440243720d57bd2248e Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Thu, 3 Nov 2011 00:42:32 +0100 Subject: Fix regular expression when replacing headers Use non-greedy capturing where it makes sense, also keep the user's whitespace indentation in his include statements Change-Id: Iff2b5dabf443529292e943ae69427bd15e702bf9 Reviewed-by: Thiago Macieira --- bin/fixqt4headers | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/fixqt4headers b/bin/fixqt4headers index 58b0fdf43d..06793414e5 100755 --- a/bin/fixqt4headers +++ b/bin/fixqt4headers @@ -13,7 +13,7 @@ for module in $modules; do includes=`ls $QTDIR/include/$module` for i in $includes; do # echo " fixing " $i - perl -pi -e "s,^#include +<.+/$i>,#include <$module/$i>," $files; + perl -pi -e "s,^#(\\s*)include(\\s+)<.+?/$i>,#\\1include\\2<$module/$i>," $files; # perl -pi -e 's,^#include +".+/$i",#include "$module/$i",' $files; done; fi; -- cgit v1.2.3