Commit 326fa606 authored by Daniel Mohns's avatar Daniel Mohns

gnome-desktop: update upstream gnome-desktop-thumbnail-script

Parity change for 
gnome-desktop!38
parent 76d31078
Pipeline #82833 running with stages
......@@ -149,7 +149,9 @@ get_extension (const char *path)
basename = g_path_get_basename (path);
p = strrchr (basename, '.');
if (p == NULL)
if (g_file_test (path, G_FILE_TEST_IS_DIR) ||
!p ||
p == basename) /* Leading periods on the basename are ignored. */
return NULL;
return g_strdup (p + 1);
}
......@@ -717,7 +719,10 @@ script_exec_free (ScriptExec *exec)
g_free (exec->infile);
if (exec->infile_tmp)
{
g_unlink (exec->infile_tmp);
if (g_file_test (exec->infile_tmp, G_FILE_TEST_IS_DIR))
g_rmdir (exec->infile_tmp);
else
g_unlink (exec->infile_tmp);
g_free (exec->infile_tmp);
}
if (exec->outfile)
......@@ -795,7 +800,12 @@ script_exec_new (const char *uri,
}
exec->outfile = g_build_filename (exec->outdir, "gnome-desktop-thumbnailer.png", NULL);
ext = get_extension (exec->infile);
infile = g_strdup_printf ("gnome-desktop-file-to-thumbnail.%s", ext);
if (ext)
infile = g_strdup_printf ("gnome-desktop-file-to-thumbnail.%s", ext);
else
infile = g_strdup_printf ("gnome-desktop-file-to-thumbnail");
exec->infile_tmp = g_build_filename (exec->outdir, infile, NULL);
exec->s_infile = g_build_filename ("/tmp/", infile, NULL);
......
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