aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2024-01-29 20:20:20 +0100
committerJoe <rbo@gmx.us>2024-01-29 20:20:20 +0100
commit6bfd76773258c8c05c345b0765bf487e2cc08fa7 (patch)
tree59222108cccd62613a4c91e1989d48fe2978296a
parentsegv (diff)
downloadhardflip-6bfd76773258c8c05c345b0765bf487e2cc08fa7.tar.gz
hardflip-6bfd76773258c8c05c345b0765bf487e2cc08fa7.tar.bz2
hardflip-6bfd76773258c8c05c345b0765bf487e2cc08fa7.tar.xz
hardflip-6bfd76773258c8c05c345b0765bf487e2cc08fa7.tar.zst
hardflip-6bfd76773258c8c05c345b0765bf487e2cc08fa7.zip
no segv
Diffstat (limited to '')
-rw-r--r--src/c_utils.go3
-rw-r--r--src/i_events.go3
-rw-r--r--src/i_ui.go10
3 files changed, 10 insertions, 6 deletions
diff --git a/src/c_utils.go b/src/c_utils.go
index 84479ce..cefffc5 100644
--- a/src/c_utils.go
+++ b/src/c_utils.go
@@ -43,7 +43,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*
* hardflip: src/c_utils.go
- * Wed Dec 20 10:50:12 2023
+ * Mon Jan 29 08:56:55 2024
* Joe
*
* core funcs
@@ -86,6 +86,7 @@ func c_get_data_dir(ui *HardUI) string {
c_die("could read path " + ptr, err)
}
c_error_mode("could read path" + ptr, err, ui)
+ return ""
// FIX: segv
}
return ptr
diff --git a/src/i_events.go b/src/i_events.go
index 11703da..e70b480 100644
--- a/src/i_events.go
+++ b/src/i_events.go
@@ -167,6 +167,9 @@ func i_fold_dir(data *HardData, item *ItemsNode) {
func i_reload_data(data *HardData) {
data.data_dir = c_get_data_dir(&data.ui)
+ if data.data_dir == "" {
+ return
+ }
g_load_count = -1
data.ldirs, data.litems, data.load_err = i_load_ui(data.data_dir, data.opts,
&data.ui)
diff --git a/src/i_ui.go b/src/i_ui.go
index 83cdf4d..9962df7 100644
--- a/src/i_ui.go
+++ b/src/i_ui.go
@@ -61,11 +61,11 @@ import (
)
type HardUI struct {
- s tcell.Screen
- mode uint8
- style [7]tcell.Style
- dim [2]int
- err [2]string
+ s tcell.Screen
+ mode uint8
+ style [7]tcell.Style
+ dim [2]int
+ err [2]string
}
func i_left_right(text_len int, ui *HardUI) (int, int) {