aboutsummaryrefslogtreecommitdiff
path: root/src/config.nim
diff options
context:
space:
mode:
authormorganamilo2018-09-11 23:02:09 +0000
committermorganamilo2018-09-11 23:12:13 +0000
commit7109cbd68e541af13dcb258d8156ddf4c46735e7 (patch)
tree1ad1c29aade117e55a7db7dc67a93eb0b84f088e /src/config.nim
parentd25443be575c5d57001cc267be69bb44b6502b72 (diff)
Strip leading whitespace in pacman.conf
Diffstat (limited to 'src/config.nim')
-rw-r--r--src/config.nim6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/config.nim b/src/config.nim
index 1937ed3..699f12a 100644
--- a/src/config.nim
+++ b/src/config.nim
@@ -64,7 +64,7 @@ proc readConfigFile*(configFile: string):
var matches: array[2, string]
while true:
- let line = readLine(file).strip(leading = false, trailing = true)
+ let line = readLine(file).strip(leading = true, trailing = true)
if line.len > 0 and line[0] != '#':
if line.match(re"\[(.*)\]", matches):
currentCategory = matches[0]
@@ -74,10 +74,10 @@ proc readConfigFile*(configFile: string):
category = newTable[string, string]()
table[currentCategory] = category
elif currentCategory.len > 0:
- if line.match(re"\ *(\w+)\ *=\ *(.*)", matches):
+ if line.match(re"(\w+)\ *=\ *(.*)", matches):
category[].add(matches[0], matches[1])
else:
- category[].add(line.strip(leading = true, trailing = false), "")
+ category[].add(line, "")
false
except EOFError: