From: Michael Tremer Date: Fri, 3 Sep 2010 17:55:33 +0000 (+0200) Subject: naoki: Don't add interpreters for files that are not executeable. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=26f43b15c407ed0982b57e4b587bf4a3fc1f32af;p=ipfire-3.x.git naoki: Don't add interpreters for files that are not executeable. --- diff --git a/tools/functions-files b/tools/functions-files index 1d306c8b6..41ce3be0c 100644 --- a/tools/functions-files +++ b/tools/functions-files @@ -45,6 +45,9 @@ function _file_get_elf_interpreter() { function _file_get_script_interpreter() { local file=${1} + # If the file is not executeable, no interpreter will be needed + [ -x "${file}" ] || return + local first_line=$(head -n1 ${file}) first_line="${first_line:2:${#first_line}}"