app: interpreter arguments for plugins not returned.

When a plugin file's shebang would start with "/usr/bin/env", the
interpreter's arguments were not returned by resolve_sh_bang().
This commit is contained in:
Jehan 2014-08-19 15:04:30 +02:00
parent 4b9bd6ba7d
commit da4247d87c
1 changed files with 10 additions and 4 deletions

View File

@ -692,12 +692,18 @@ resolve_sh_bang (GimpInterpreterDB *db,
{
if (strcmp ("/usr/bin/env", name) == 0)
{
program = g_hash_table_lookup (db->programs, cp);
if (program)
return g_strdup (program);
/* Shift program name and arguments to the right. */
name = cp;
for ( ; *cp && (*cp != ' ') && (*cp != '\t'); cp++)
;
while ((*cp == ' ') || (*cp == '\t'))
*cp++ = '\0';
}
*interp_arg = g_strdup (cp);
if (*cp)
*interp_arg = g_strdup (cp);
}
program = g_hash_table_lookup (db->programs, name);