[gimp] app: also search interpreters executable in $PATH.
- From: Jehan <jehanp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: also search interpreters executable in $PATH.
- Date: Sat, 16 Jun 2018 01:23:44 +0000 (UTC)
commit 0af3ae81ff43d5a7cc94c7bf54afa943721a07a9
Author: Jehan <jehan girinstud io>
Date: Sat Jun 16 03:14:43 2018 +0200
app: also search interpreters executable in $PATH.
Same as we did for binfmt-style lines, if the executable part (for
instance in `pygimp.interp`) is not an absolute path, let's allow
ourselves to find it in the environment $PATH.
(cherry picked from commit f3c5ed55c884dacac96b0aae5d3af65f7ef7a73f)
app/plug-in/gimpinterpreterdb.c | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
---
diff --git a/app/plug-in/gimpinterpreterdb.c b/app/plug-in/gimpinterpreterdb.c
index 5597e54959..4f981237d3 100644
--- a/app/plug-in/gimpinterpreterdb.c
+++ b/app/plug-in/gimpinterpreterdb.c
@@ -294,14 +294,22 @@ gimp_interpreter_db_add_program (GimpInterpreterDB *db,
if (! g_file_test (program, G_FILE_TEST_IS_EXECUTABLE))
{
- g_message (_("Bad interpreter referenced in interpreter file %s: %s"),
- gimp_file_get_utf8_name (file),
- gimp_filename_to_utf8 (program));
- return;
+ program = g_find_program_in_path (program);
+ if (! program || ! g_file_test (program, G_FILE_TEST_IS_EXECUTABLE))
+ {
+ g_message (_("Bad interpreter referenced in interpreter file %s: %s"),
+ gimp_file_get_utf8_name (file),
+ gimp_filename_to_utf8 (program));
+ if (program)
+ g_free (program);
+ return;
+ }
}
+ else
+ program = g_strdup (program);
if (! g_hash_table_lookup (db->programs, name))
- g_hash_table_insert (db->programs, g_strdup (name), g_strdup (program));
+ g_hash_table_insert (db->programs, g_strdup (name), program);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]