mirror of
https://github.com/amir1376/ab-download-manager.git
synced 2025-02-20 11:43:24 +08:00
force wrap file path by quotes (#351)
This commit is contained in:
parent
b8ce924ad8
commit
a9aa532d5f
@ -10,7 +10,7 @@ import java.io.File
|
|||||||
|
|
||||||
internal class WindowsFileUtils : FileUtilsBase() {
|
internal class WindowsFileUtils : FileUtilsBase() {
|
||||||
override fun openFileInternal(file: File): Boolean {
|
override fun openFileInternal(file: File): Boolean {
|
||||||
return execAndWait(arrayOf("cmd", "/c", "start", "/B", "", file.path))
|
return execAndWait(arrayOf("cmd", "/c", "start", "/B", "", file.path.quoted()))
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun openFolderOfFileInternal(file: File): Boolean {
|
override fun openFolderOfFileInternal(file: File): Boolean {
|
||||||
@ -19,7 +19,7 @@ internal class WindowsFileUtils : FileUtilsBase() {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
//fallback to use explorer
|
//fallback to use explorer
|
||||||
return execAndWait(arrayOf("cmd", "/c", "explorer.exe", "/select,", file.path))
|
return execAndWait(arrayOf("cmd", "/c", "explorer.exe", "/select,", file.path.quoted()))
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun openFolderInternal(folder: File): Boolean {
|
override fun openFolderInternal(folder: File): Boolean {
|
||||||
@ -28,7 +28,7 @@ internal class WindowsFileUtils : FileUtilsBase() {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
//fallback to use explorer
|
//fallback to use explorer
|
||||||
return execAndWait(arrayOf("cmd", "/c", "explorer.exe", folder.path))
|
return execAndWait(arrayOf("cmd", "/c", "explorer.exe", folder.path.quoted()))
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun showFileInFolderViaNative(
|
private fun showFileInFolderViaNative(
|
||||||
@ -72,6 +72,9 @@ internal class WindowsFileUtils : FileUtilsBase() {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun String.quoted() = "\"$this\""
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user