Pi66

pind
Simple Rust hotkey daemon.
git clone https://git.pi66.xyz/pind

← back to log

fix: handle empty lines in config

author: pixel2175
date: 2025-08-14 14:20
hash: 58efa3a578f7488d4a7e794192030bfec0a00ef6

Diffstat:

M

src/main.rs
2 +++++++++++++++---------------
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
diff --git a/src/main.rs b/src/main.rs
index 942da44..7ecdf48 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -165,7 +165,7 @@ fn load_config(config:&str) -> Vec<(AttributeSet<KeyCode>, String)>
         exit(1)
     });
     for line in content.lines() {
-        if !line.starts_with("#") || line.trim().is_empty() {
+        if !line.starts_with("#") && !line.trim().is_empty() {
             let mut l = line.splitn(2, ":");
             let key = l
                 .next()