aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2024-09-23 15:05:04 +0200
committerJoe <rbo@gmx.us>2024-09-23 15:05:04 +0200
commit7980ee0daaa24253436f27cabf72f34ae540dee8 (patch)
tree7f4a3769ebe7bef9cb53e941d79f869a8bcca69d
parentup (diff)
downloadhardflip-7980ee0daaa24253436f27cabf72f34ae540dee8.tar.gz
hardflip-7980ee0daaa24253436f27cabf72f34ae540dee8.tar.bz2
hardflip-7980ee0daaa24253436f27cabf72f34ae540dee8.tar.xz
hardflip-7980ee0daaa24253436f27cabf72f34ae540dee8.tar.zst
hardflip-7980ee0daaa24253436f27cabf72f34ae540dee8.zip
fixed segv
-rw-r--r--src/e_keys.go5
-rw-r--r--src/i_host.go6
2 files changed, 1 insertions, 10 deletions
diff --git a/src/e_keys.go b/src/e_keys.go
index 7ec82cc..e7c71c8 100644
--- a/src/e_keys.go
+++ b/src/e_keys.go
@@ -180,10 +180,7 @@ func e_normal_events(data *HardData, ui *HardUI, event tcell.EventKey) bool {
data.insert = &HostNode{}
tmp.Host = data.insert
if data.litems.curr == nil {
- data.litems.add_back(&tmp)
- ui.s.Fini()
- // FIX: segv if void
- return true
+ tmp.Host.parent = data.ldirs.head
} else if data.litems.curr.is_dir() == true {
data.insert.parent = data.litems.curr.Dirs
} else {
diff --git a/src/i_host.go b/src/i_host.go
index 04167a6..ed4ac77 100644
--- a/src/i_host.go
+++ b/src/i_host.go
@@ -51,8 +51,6 @@
package main
-import "fmt"
-
func i_host_panel_dirs(ui HardUI, icons bool, dir_icon uint8,
dir *DirsNode, curr *DirsNode, line int) {
style := ui.style[DIR_STYLE]
@@ -121,10 +119,6 @@ func i_draw_host_panel(ui HardUI, icons bool,
}
for ptr := litems.draw; ptr != nil && line < ui.dim[H] - 2; ptr = ptr.next {
if ptr.is_dir() == false && ptr.Host != nil {
- fmt.Println(ptr);
- fmt.Println(ptr.ID);
- fmt.Println(ptr.Host);
- fmt.Println(ptr.Host.parent);
i_host_panel_host(ui,
icons,
ptr.Host.parent.Depth,