[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] gnulib-tool.py: Fix whitespace in gnulib-comp.m4.
From: |
Bruno Haible |
Subject: |
Re: [PATCH] gnulib-tool.py: Fix whitespace in gnulib-comp.m4. |
Date: |
Thu, 28 Mar 2024 11:46:56 +0100 |
Hi Collin,
> In the the ./import-tests/test-wget2-1.sh output of gnulib-comp.m4
> there is this whitespace diff:
>
> $ diff -u ./test-wget2-1.result/m4/gnulib-comp.m4
> tmp115629-result/m4/gnulib-comp.m4
> --- ./test-wget2-1.result/m4/gnulib-comp.m4 2024-03-27 03:05:35.527866182
> -0700
> +++ tmp115629-result/m4/gnulib-comp.m4 2024-03-27 21:12:14.079772897
> -0700
> @@ -462,7 +463,7 @@
> gl_CONDITIONAL([GL_COND_OBJ_ACCESS], [test $REPLACE_ACCESS = 1])
> gl_UNISTD_MODULE_INDICATOR([access])
> gl_ALIGNASOF
> -changequote(,)dnl
> + changequote(,)dnl
> LTALLOCA=`echo "$ALLOCA" | sed -e 's/\.[^.]* /.lo /g;s/\.[^.]*$/.lo/'`
> changequote([, ])dnl
> AC_SUBST([LTALLOCA])
>
> This tiny patch fixes it.
Thanks! Applied.
> It looks like lines_to_multiline returned an
> empty string which is accepted by the regular expression and added 2
> spaces infront of it.
Yes, the regular expression
re.compile(r'^(.*)$', re.M)
when applied to a string consisting of N newline-terminated lines,
matches N+1 times. While 'sed' would see N lines, Python sees N+1 lines,
the last line being empty and not newline-terminated.
Bruno