diff --git a/apps/multiplatform/common/src/desktopMain/kotlin/chat/simplex/common/platform/Files.desktop.kt b/apps/multiplatform/common/src/desktopMain/kotlin/chat/simplex/common/platform/Files.desktop.kt index 9720a78435..970876c7d3 100644 --- a/apps/multiplatform/common/src/desktopMain/kotlin/chat/simplex/common/platform/Files.desktop.kt +++ b/apps/multiplatform/common/src/desktopMain/kotlin/chat/simplex/common/platform/Files.desktop.kt @@ -116,7 +116,7 @@ private fun fileFilterDescription(input: String): String = when(input) { else -> "" } -internal fun saveDialogFileName(name: String): String = name.trimStart('.').ifEmpty { name } +internal fun saveDialogFileName(name: String): String = name.trimStart('.', '<').ifEmpty { name } actual fun URI.inputStream(): InputStream? = toFile().inputStream() actual fun URI.outputStream(): OutputStream = toFile().outputStream() diff --git a/apps/multiplatform/common/src/desktopTest/kotlin/chat/simplex/app/SaveDialogFileNameTest.kt b/apps/multiplatform/common/src/desktopTest/kotlin/chat/simplex/app/SaveDialogFileNameTest.kt index 21b3d2e341..6d903a0b4b 100644 --- a/apps/multiplatform/common/src/desktopTest/kotlin/chat/simplex/app/SaveDialogFileNameTest.kt +++ b/apps/multiplatform/common/src/desktopTest/kotlin/chat/simplex/app/SaveDialogFileNameTest.kt @@ -6,9 +6,10 @@ import kotlin.test.assertEquals class SaveDialogFileNameTest { @Test - fun testLeadingDotsRemoved() { + fun testLeadingDotsAndLessThanSignsRemoved() { assertEquals("bashrc", saveDialogFileName(".bashrc")) assertEquals("hidden.txt", saveDialogFileName("..hidden.txt")) + assertEquals("notes.txt", saveDialogFileName("