anndl: Fixed a couple of bugs.
[utils.git] / lddot
diff --git a/lddot b/lddot
index 5c3568c..bdbc5eb 100755 (executable)
--- a/lddot
+++ b/lddot
@@ -5,7 +5,7 @@ while read dir; do
     if [ "${dir:0:1}" == "#" ]; then
        continue
     elif [ -d "$dir" ]; then
-       ldpath=$("${LDPATH[@]}" "$dir")
+       ldpath=("${ldpath[@]}" "$dir")
     fi
 done </etc/ld.so.conf
 ldpath=("${ldpath[@]}" /usr/lib /lib)
@@ -41,7 +41,7 @@ has() {
 excluded() {
     for obj in "${exclude[@]}"; do
        if [ -d "$obj" ] && [[ "$1" == "$obj"* ]]; then return 0; fi
-       if [ "$1" = "$obj" ]; then return 0; fi
+       if [ "$1" -ef "$obj" ]; then return 0; fi
     done
     return 1
 }
@@ -52,9 +52,10 @@ examine() {
     objdump -p "$1" | sed -n 's/^.*NEEDED \+\(lib.*\)/\1/p' >"$tfile"
     while read lib; do
        if ! lib2="$(findlib "$lib")"; then
+           echo "\"$lib\" [ color=red ];"
            echo "lddot: $lib: not found" >&2
-           rm -f "$tfile"
-           return 1
+           echo "\"$1\" -> \"$lib\";"
+           continue
        fi
        lib="$lib2"
        unset lib2
@@ -107,6 +108,7 @@ for bin in "${programs[@]}"; do
        rv=1
        continue
     fi
+    echo "\"$bin\" [ shape=box ];"
     if ! examine "$bin"; then rv=1; fi
 done
 echo "}"