From c5575c7ed921400a3ebed1aea8306a6f572c705e Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Sun, 11 Feb 2018 20:56:11 +0100 Subject: [PATCH] Strip spaces from items read via --files-from In #1590, it was mentioned that while lines read from exclude files via `--exclude-file` have leading and trailing spaces stripped, this is not the case for lines read via `--files-from`. This commit fixes that, spaces are always stripped. --- cmd/restic/cmd_backup.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/restic/cmd_backup.go b/cmd/restic/cmd_backup.go index 67378e115..4e78a1534 100644 --- a/cmd/restic/cmd_backup.go +++ b/cmd/restic/cmd_backup.go @@ -304,7 +304,7 @@ func readLinesFromFile(filename string) ([]string, error) { scanner := bufio.NewScanner(r) for scanner.Scan() { - line := scanner.Text() + line := strings.TrimSpace(scanner.Text()) // ignore empty lines if line == "" { continue