From 36de5db9f0af1fb2e788f890d7f28f1f8239bd4b Mon Sep 17 00:00:00 2001 From: Ingo Meyer <1449087+IngoMeyer441@users.noreply.github.com> Date: Wed, 20 Jan 2021 12:34:56 +0100 Subject: [PATCH] [Tagpreview] Handle absolute file paths correctly (#1229) Fix #1228 --- bin/tagpreview.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/tagpreview.sh b/bin/tagpreview.sh index 0e0b574..c1303d5 100755 --- a/bin/tagpreview.sh +++ b/bin/tagpreview.sh @@ -10,7 +10,10 @@ fi IFS=':' read -r FILE TAGFILE EXCMD <<< "$*" -FILE="$(dirname "${TAGFILE}")/${FILE}" +# Complete file paths which are relative to the given tag file +if [ "${FILE:0:1}" != "/" ]; then + FILE="$(dirname "${TAGFILE}")/${FILE}" +fi if [ ! -r "$FILE" ]; then echo "File not found ${FILE}"