Skip to content

Commit 5ac2a2e

Browse files
committed
SDL: Fix regression with "go up" navigation on win32
1 parent 4e65e57 commit 5ac2a2e

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

ChangeLog

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
2023-01-20 (12.26)
1+
2023-02-19 (12.26)
22
SDL: Fixed an issue with window resizing #144
3+
COMMON: Fixed "make dist" so it can produce a package with all internal dependencies
34

45
2023-01-20 (12.26)
56
COMMON: Fixed DIM lower bound

src/platform/android/app/src/main/assets/main.bas

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const colNav2 = theme.text6
1616
const menu_gap = -(char_w / 2)
1717
const is_android = instr(sbver, "Android") != 0
1818
const is_sdl = instr(sbver, "SDL") != 0
19+
const path_sep = iff(instr(sbver, "Win_") != 0, "\\", "/")
1920
const onlineUrl = "http://smallbasic.github.io/samples/index.bas"
2021
const idxEdit = 6
2122
const idxFiles = 7
@@ -321,7 +322,7 @@ sub listFiles(byref frm, path, sortDir, byref basList)
321322
local date_col = colNav
322323

323324
sub fix_path
324-
if (right(path, 1) != "/") then path += "/"
325+
if (right(path, 1) != path_sep) then path += path_sep
325326
end
326327

327328
fix_path
@@ -679,17 +680,19 @@ sub main
679680
sub go_back
680681
local backPath, index
681682
backPath = ""
682-
index = iff(isstring(path), rinstr(path, "/"), 0)
683+
index = iff(isstring(path), rinstr(path, path_sep), 0)
683684
if (index > 0 && index == len(path)) then
684-
index = rinstr(left(path, index - 1), "/")
685-
fi
685+
index = rinstr(left(path, index - 1), path_sep)
686+
endif
686687
if (index == 1) then
687688
index++
688-
fi
689+
endif
689690
if (index > 0)
690691
backPath = left(path, index - 1)
692+
else if (mid(path, 2, 1) == ":") then
693+
backPath = path
691694
else
692-
backPath = "/"
695+
backPath = path_sep
693696
endif
694697
path = backPath
695698
end

0 commit comments

Comments
 (0)