diff options
author | Konstantin Unruh <[email protected]> | 2021-02-20 18:50:23 +0100 |
---|---|---|
committer | raveit65 <[email protected]> | 2022-07-21 19:33:51 +0200 |
commit | 48a91c09095d383b3f25cca8b2c9d79c1daf7e3b (patch) | |
tree | a7569cd63be414118f5c3e3fb303485783112c9d /libcaja-private | |
parent | bba4e9f1ed5f5e658dd85f83a300eb6629796d68 (diff) | |
download | caja-48a91c09095d383b3f25cca8b2c9d79c1daf7e3b.tar.bz2 caja-48a91c09095d383b3f25cca8b2c9d79c1daf7e3b.tar.xz |
keep one .desktop suffix on desktop file renaming
Diffstat (limited to 'libcaja-private')
-rw-r--r-- | libcaja-private/caja-file.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libcaja-private/caja-file.c b/libcaja-private/caja-file.c index be9751d6..afaddf20 100644 --- a/libcaja-private/caja-file.c +++ b/libcaja-private/caja-file.c @@ -1925,7 +1925,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)) { |