From a0df7f63792f0970100efff856ea0076e3faf15e Mon Sep 17 00:00:00 2001 From: Konstantin Unruh Date: Sat, 20 Feb 2021 18:50:23 +0100 Subject: keep one .desktop suffix on desktop file renaming --- libcaja-private/caja-file.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-file.c b/libcaja-private/caja-file.c index 1b3bf220..be5a5732 100644 --- a/libcaja-private/caja-file.c +++ b/libcaja-private/caja-file.c @@ -1931,7 +1931,10 @@ caja_file_rename (CajaFile *file, g_error_free (error); return; } - new_file_name = g_strdup_printf ("%s.desktop", new_name); + if (!g_str_has_suffix(new_name, ".desktop")) + new_file_name = g_strdup_printf ("%s.desktop", new_name); + else + new_file_name = g_strdup_printf("%s", new_name); new_file_name = g_strdelimit (new_file_name, "/", '-'); if (name_is (file, new_file_name)) { -- cgit v1.2.1