app: when interpreter not found in interpreter DB, leave shebang as-is.
In particular, if the shebang is `#!/usr/bin/env lang` and we have not
registered a specific interpreter for `lang`, the system should leave
the env tool search the right interpreter for us. We only bypass env
when we set our own explicit interpreter.
(cherry picked from commit 9e844ae1d7
)
Slight modification from master commit: not applying to
palette-to-gradient.py plug-in.
This commit is contained in:
@ -721,7 +721,14 @@ resolve_sh_bang (GimpInterpreterDB *db,
|
|||||||
{
|
{
|
||||||
if (strcmp ("/usr/bin/env", name) == 0)
|
if (strcmp ("/usr/bin/env", name) == 0)
|
||||||
{
|
{
|
||||||
/* Shift program name and arguments to the right. */
|
program = g_hash_table_lookup (db->programs, cp);
|
||||||
|
|
||||||
|
if (program)
|
||||||
|
{
|
||||||
|
/* Shift program name and arguments to the right, if and
|
||||||
|
* only if we recorded a specific interpreter for such
|
||||||
|
* script. Otherwise let `env` tool do its job.
|
||||||
|
*/
|
||||||
name = cp;
|
name = cp;
|
||||||
|
|
||||||
for ( ; *cp && (*cp != ' ') && (*cp != '\t'); cp++)
|
for ( ; *cp && (*cp != ' ') && (*cp != '\t'); cp++)
|
||||||
@ -730,6 +737,7 @@ resolve_sh_bang (GimpInterpreterDB *db,
|
|||||||
while ((*cp == ' ') || (*cp == '\t'))
|
while ((*cp == ' ') || (*cp == '\t'))
|
||||||
*cp++ = '\0';
|
*cp++ = '\0';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (*cp)
|
if (*cp)
|
||||||
*interp_arg = g_strdup (cp);
|
*interp_arg = g_strdup (cp);
|
||||||
|
Reference in New Issue
Block a user