filelist: trim whitespace from lines read from files (MR 55)

Fixes issues with leading/trailing whitespaces really messing with mkinitfs
This commit is contained in:
Clayton Craft
2024-07-11 11:33:57 -07:00
parent 1fed057a82
commit cd97df108a
4 changed files with 7 additions and 6 deletions

View File

@@ -59,7 +59,7 @@ func slurpFiles(fd io.Reader) (*filelist.FileList, error) {
s := bufio.NewScanner(fd)
for s.Scan() {
line := s.Text()
line := strings.TrimSpace(s.Text())
if len(line) == 0 || strings.HasPrefix(line, "#") {
continue
}