Commit b67d7c44 authored by Jehan's avatar Jehan

app: fix "Bad interpreter" error messaging.

If I override the `program` variable, and it is not found in PATH
environment, then it is NULL and the error message is unhelpful. Make
the return value of g_find_program_in_path() into a separate variable
instead, and only override `program` in the end, when we know it is
non-NULL.

(cherry picked from commit 87a9feb6)
parent f1ff239d
......@@ -294,16 +294,19 @@ gimp_interpreter_db_add_program (GimpInterpreterDB *db,
if (! g_file_test (program, G_FILE_TEST_IS_EXECUTABLE))
{
program = g_find_program_in_path (program);
if (! program || ! g_file_test (program, G_FILE_TEST_IS_EXECUTABLE))
gchar *prog;
prog = g_find_program_in_path (program);
if (! prog || ! g_file_test (prog, 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);
if (prog)
g_free (prog);
return;
}
program = prog;
}
else
program = g_strdup (program);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment