From 387372d30299dbc6a2ed94136ef1594c1b95792c Mon Sep 17 00:00:00 2001 From: Ain <41307858+nero@users.noreply.github.com> Date: Tue, 30 Jan 2018 20:42:45 +0000 Subject: [PATCH] Fix finddeps --- finddeps.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/finddeps.sh b/finddeps.sh index 0b3e0a8..3ace729 100755 --- a/finddeps.sh +++ b/finddeps.sh @@ -4,8 +4,8 @@ search() { echo "$1" prefix="$(printf "%s\n" "$1"|sed 's|[^/]*$||')" deps="$(grep -E '^#include "[^"]*"$' "$1"|cut '-d"' -f2| - \sed "s|^|$prefix|;s|\.h\$|.c|"|grep -v "$1")" + \sed "s|^|$prefix|;s|\.h\$|.c|"|grep -v "^$1")" for i in $deps; do search $i; done } -search "$1"|sort -u|grep -v "$1"|sed 's|\.c$|.o|' +search "$1"|sort -u|grep -v "^$1"|sed 's|\.c$|.o|'