gnulib-tool: correctly detect absence of m4 directories
authorRobert Millan <rmh.grub@aybabtu.com>
Sat, 14 Nov 2009 13:45:02 +0000 (06:45 -0700)
committerEric Blake <ebb9@byu.net>
Sat, 14 Nov 2009 13:46:25 +0000 (06:46 -0700)
$m4dirs is incorrectly counting.  In my particular case
(correct value: 0, detected value: 1), this resulted in gnulib-tool
silently exitting with no visible error (and no job done).

* gnulib-tool: Avoid extra newline on data passed to wc -l.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
gnulib-tool

index c821d8d..5fbff63 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-11-14  Robert Millan  <rmh.grub@aybabtu.com>  (tiny change)
+
+       gnulib-tool: correctly detect absence of m4 directories
+       * gnulib-tool: Avoid extra newline on data passed to wc -l.
+
 2009-11-14  Jim Meyering  <meyering@redhat.com>
 
        maint.mk: Prohibit inclusion of "xalloc.h" without use.
index 397f442..aafd345 100755 (executable)
@@ -4500,7 +4500,7 @@ case $mode in
           sedexpr2='s,^[^/]*$,.,'
           sedexpr3='s,/[^/]*$,,'
           m4dirs=`sed -n -e "$sedexpr1" aclocal.m4 | sed -e "$sedexpr2" -e "$sedexpr3" | LC_ALL=C sort -u`
-          m4dirs_count=`echo "$m4dirs" | wc -l`
+          m4dirs_count=`printf %s "$m4dirs" | wc -l`
         fi
       fi
       if test $m4dirs_count = 0; then