commit db7a4e7c87be21e73a899056302db3db733b37ca
parent 3eed986989ddd2a7473f6896ba5751b6a51b0a37
Author: Drew DeVault <sir@cmpwn.com>
Date: Mon, 21 Jun 2021 13:11:35 -0400
unix::resolvconf, unix::hosts: handle empty lines
Signed-off-by: Drew DeVault <sir@cmpwn.com>
Diffstat:
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/unix/hosts/lookup.ha b/unix/hosts/lookup.ha
@@ -21,7 +21,7 @@ export fn lookup(name: str) (ip::addr | void) = {
line: []u8 => line,
};
defer free(line);
- if (line[0] == '#': u32: u8) {
+ if (line[0] == '#': u32: u8 || len(line) == 0) {
continue;
};
diff --git a/unix/resolvconf/load.ha b/unix/resolvconf/load.ha
@@ -31,7 +31,7 @@ export fn load() []ip::addr = {
line: []u8 => line,
};
defer free(line);
- if (line[0] == '#': u32: u8) {
+ if (line[0] == '#': u32: u8 || len(line) == 0) {
continue;
};