diff options
author | Konstantin Unruh <[email protected]> | 2021-02-20 18:50:23 +0100 |
---|---|---|
committer | Robert Antoni Buj Gelonch <[email protected]> | 2021-03-11 09:27:01 +0100 |
commit | f7b858bc118e018e81ff29340e86e12a3e82e986 (patch) | |
tree | 374ea66acf0333d929d98a893d6adc3330ae7953 | |
parent | 58022791da71d950a715273063bce36aaeedcd0a (diff) | |
download | caja-f7b858bc118e018e81ff29340e86e12a3e82e986.tar.bz2 caja-f7b858bc118e018e81ff29340e86e12a3e82e986.tar.xz |
keep one .desktop suffix on desktop file renaming
-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 db8bda9a..25660700 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)) { |