nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
479a304
)
lib/ini: do not abort when lines does not have "="
author
Jean Privat
<jean@pryen.org>
Wed, 1 Mar 2017 19:08:50 +0000
(14:08 -0500)
committer
Jean Privat
<jean@pryen.org>
Wed, 1 Mar 2017 19:17:18 +0000
(14:17 -0500)
aborting in a library is badâ„¢
Signed-off-by: Jean Privat <jean@pryen.org>
lib/ini.nit
patch
|
blob
|
history
diff --git
a/lib/ini.nit
b/lib/ini.nit
index
84b200c
..
5e7c671
100644
(file)
--- a/
lib/ini.nit
+++ b/
lib/ini.nit
@@
-208,9
+208,9
@@
class ConfigTree
path = key
set_node(path, null)
else
- var parts = line.split("=")
- assert parts.length > 1 else
- print "Error: malformed ini at line {line_number}"
+ var parts = line.split_once_on("=")
+ if parts.length == 1 then
+ continue
end
var key = parts[0].trim
var val = parts[1].trim