]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
libtoolize: Don't use uninitialized variable.
authorBruno Haible <bruno@clisp.org>
Tue, 14 May 2024 15:37:20 +0000 (17:37 +0200)
committerIleana Dumitrescu <ileanadumitrescu95@gmail.com>
Sat, 18 May 2024 13:04:29 +0000 (16:04 +0300)
* libtoolize.in (func_serial_update): Initialize my_src_serial and
my_dest_serial before use.
* tests/libtoolize.at: Update expected test result.

libtoolize.in
tests/libtoolize.at

index 336fc81bd5ea5aea162e941bebd4a453a453fa58..af25a49540df05931b69564a20596db2d5e89883 100644 (file)
@@ -657,6 +657,8 @@ func_serial_update ()
 
     test -f "$my_srcfile" || func_fatal_error "'$my_srcfile' does not exist."
 
+    my_src_serial=
+    my_dest_serial=
     if test -f "$my_destfile"; then
       my_src_serial=`func_serial "$my_srcfile" "$my_macro_regex"`
       my_dest_serial=`func_serial "$my_destfile" "$my_macro_regex"`
@@ -696,7 +698,7 @@ func_serial_update ()
       # serial tags, so the update message will be correctly given
       # if aclocal.m4 contains an untagged --i.e older-- macro file):
       *)
-        if test -f aclocal.m4; then
+        if test -f aclocal.m4 && test '' != "$my_src_serial"; then
           func_serial_max \
               "$my_src_serial" `func_serial aclocal.m4 "$my_macro_regex"`
           if test "X$my_src_serial" = "X$func_serial_max_result"; then
index cbc21d68b61d2da7a3489003bf76c6b99fbd8d66..a9ed75a675d9e459369bac071593819d54b17124 100644 (file)
@@ -681,11 +681,8 @@ AT_DATA([expout],
 libtoolize: copying file 'm4/libtool.m4'
 libtoolize: copying file 'm4/ltoptions.m4'
 libtoolize: copying file 'm4/ltsugar.m4'
-libtoolize: You should add the contents of 'm4/ltsugar.m4' to 'aclocal.m4'.
 libtoolize: copying file 'm4/ltversion.m4'
-libtoolize: You should add the contents of 'm4/ltversion.m4' to 'aclocal.m4'.
 libtoolize: copying file 'm4/lt~obsolete.m4'
-libtoolize: You should add the contents of 'm4/lt~obsolete.m4' to 'aclocal.m4'.
 ]])
 
 LT_AT_CHECK_LIBTOOLIZE([--copy], 0, expout)