mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-27 16:06:16 +01:00
Merge branch 'fix-g_find_program_in_path' into 'main'
gutils: Fix g_find_program_in_path() to return an absolute path Closes #2586 See merge request GNOME/glib!2460
This commit is contained in:
commit
13ee46538f
@ -456,7 +456,14 @@ g_find_program_in_path (const gchar *program)
|
||||
!g_file_test (startp, G_FILE_TEST_IS_DIR))
|
||||
{
|
||||
gchar *ret;
|
||||
ret = g_strdup (startp);
|
||||
if (g_path_is_absolute (startp)) {
|
||||
ret = g_strdup (startp);
|
||||
} else {
|
||||
gchar *cwd = NULL;
|
||||
cwd = g_get_current_dir ();
|
||||
ret = g_build_filename (cwd, startp, NULL);
|
||||
g_free (cwd);
|
||||
}
|
||||
g_free (freeme);
|
||||
#ifdef G_OS_WIN32
|
||||
g_free ((gchar *) path_copy);
|
||||
|
Loading…
Reference in New Issue
Block a user