Fixed: dashbaord 404 when put clashx in directory has spaces inside

This commit is contained in:
yicheng 2019-01-13 10:27:44 +08:00
parent bdcbb93122
commit 903674efa8

View File

@ -224,8 +224,8 @@ class AppDelegate: NSObject, NSApplicationDelegate {
if (ConfigManager.shared.isRunning){return}
// setup ui config first
if let htmlPath = Bundle.main.path(forResource: "index", ofType: "html", inDirectory: "dashboard") ,
let uiPath = URL(string: htmlPath)?.deletingLastPathComponent().absoluteString.dropLast() {
if let htmlPath = Bundle.main.path(forResource: "index", ofType: "html", inDirectory: "dashboard") {
let uiPath = URL(fileURLWithPath: htmlPath).deletingLastPathComponent().path
let path = String(uiPath)
let length = path.count + 1
let buffer = UnsafeMutablePointer<Int8>.allocate(capacity: length)