summaryrefslogtreecommitdiff
path: root/scripts/tags.sh
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2019-04-29 13:06:43 +0900
committerMasahiro Yamada <yamada.masahiro@socionext.com>2019-05-03 23:05:01 +0900
commitc69ef1c87b8c35ab9cc6b7d3b9395efd5ca6bc4d (patch)
treeaad73e083e3d4c809fc8d13539b2ba9b4547dd61 /scripts/tags.sh
parente46b94d228458aefc2553ee7c34ab18c2e3288e3 (diff)
scripts/tags.sh: fix direct execution of scripts/tags.sh
I thought this script was run via "make tags" etc. but some people run it directly. Prior to commit a9a49c2ad9b9 ("kbuild: use $(srctree) instead of KBUILD_SRC to check out-of-tree build"), in such a usecase, "tree" was set empty since KBUILD_SRC is undefined. Now, "tree" is set to "${srctree}/", which is evaluated to "/". Fix it by taking into account the case where "srctree" is unset. Link: https://lkml.org/lkml/2019/4/19/501 Fixes: a9a49c2ad9b9 ("kbuild: use $(srctree) instead of KBUILD_SRC to check out-of-tree build") Reported-by: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'scripts/tags.sh')
-rwxr-xr-xscripts/tags.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/tags.sh b/scripts/tags.sh
index 6a551805db52..70e14c67bde7 100755
--- a/scripts/tags.sh
+++ b/scripts/tags.sh
@@ -19,7 +19,7 @@ ignore="$ignore ( -name *.mod.c ) -prune -o"
# Do not use full path if we do not use O=.. builds
# Use make O=. {tags|cscope}
# to force full paths for a non-O= build
-if [ "${srctree}" = "." ]; then
+if [ "${srctree}" = "." -o -z "${srctree}" ]; then
tree=
else
tree=${srctree}/