From f692339a367c103f5a423816c55054bf4b37a6a2 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Mon, 15 Mar 2021 20:57:34 +0200 Subject: [PATCH] Fix #10988 --- .../src/net/osmand/plus/dialogs/RenameFileBottomSheet.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/dialogs/RenameFileBottomSheet.java b/OsmAnd/src/net/osmand/plus/dialogs/RenameFileBottomSheet.java index f2bfe0e6e7..aa60bc0426 100644 --- a/OsmAnd/src/net/osmand/plus/dialogs/RenameFileBottomSheet.java +++ b/OsmAnd/src/net/osmand/plus/dialogs/RenameFileBottomSheet.java @@ -131,7 +131,10 @@ public class RenameFileBottomSheet extends MenuBottomSheetDialogFragment { File dest; int index = file.getName().lastIndexOf('.'); String ext = index == -1 ? "" : file.getName().substring(index); - String newName = Algorithms.getFileNameWithoutExtension(selectedFileName); + String newName = selectedFileName; + if (selectedFileName.endsWith(ext)) { + newName = selectedFileName.substring(0, selectedFileName.lastIndexOf(ext)); + } if (SQLiteTileSource.EXT.equals(ext)) { dest = renameSQLiteFile(app, file, newName + ext, null); } else if (IndexConstants.GPX_FILE_EXT.equals(ext)) {