libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug#517501: libtool: uninitialized shell variable causes link failur


From: Ralf Wildenhues
Subject: Re: Bug#517501: libtool: uninitialized shell variable causes link failure when run under zsh
Date: Sat, 28 Feb 2009 13:29:04 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

tags fixed-upstream
thanks

[ adding libtool-patches; see <http://bugs.debian.org/517501> ]

OK, here's the deal: 'emulate sh' turns off the special properties of
the $path array, but keeps its first entry:

$ zsh -c 'echo $path.; emulate sh; echo $path.'
/usr/local/bin /usr/bin /bin /usr/bin/X11 /usr/games /usr/X11R6/bin.
/usr/local/bin.

BTW, this doesn't happen if zsh is invoked as sh:
$ ln -s /usr/bin/zsh sh; ./sh -c 'echo $path.; emulate sh; echo $path.'
.
.

Not sure whether that may be considered a bug in zsh or not, but anyway
libtool should not assume that the ordinary variable $path is unset.

Your proposed patch does not set $path in all possible cases, so I'm
applying this one to upstream GNU Libtool to fix it.

Cheers, and thanks again,
Ralf

2009-02-28  Török Edwin  <address@hidden>  (tiny change)
            Ralf Wildenhues  <address@hidden>

        Do not add bogus directory arguments to link command lines.
        * libltdl/config/ltmain.m4sh (func_mode_link): Ensure $path is
        always initialized before it is used.  Reported for zsh, for
        which $path contains $PATH entries even after "emulate sh", see
        <http://bugs.debian.org/517501>.

diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index 49e07c3..7fcf4cb 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -5624,6 +5624,7 @@ func_mode_link ()
          if test "$link_all_deplibs" != no; then
            # Add the search paths of all dependency libraries
            for deplib in $dependency_libs; do
+             path=
              case $deplib in
              -L*) path="$deplib" ;;
              *.la)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]