From 7109cbd68e541af13dcb258d8156ddf4c46735e7 Mon Sep 17 00:00:00 2001 From: morganamilo Date: Wed, 12 Sep 2018 00:02:09 +0100 Subject: Strip leading whitespace in pacman.conf --- src/config.nim | 6 +++--- 1 file 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: -- cgit v1.2.3-70-g09d2