diff --git a/autogen.sh b/autogen.sh
index f6bfde6..e6d7ef4 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -224,7 +224,8 @@ do_git=
## Create nt/gnulib.mk if it doesn't exist, as autoreconf will need it.
if test ! -f nt/gnulib.mk; then
echo 'Inferring nt/gnulib.mk from lib/gnulib.mk ...'
- metascript='/^[^#]/s|^.*$|/^## begin *gnulib module &/,/^## end *gnulib module &/c ## gnulib module & removed|'
+ metascript='/^[^#]/s|^.*$|/^## begin *gnulib module &/,/^## end *gnulib module &/c\
+ ## gnulib module & removed|'
script=`sed "$metascript" nt/gnulib-modules-to-delete.cfg` || exit
sed "$script" lib/gnulib.mk > nt/gnulib.mk || exit
fi