Merge pull request #1613 from restic/strip-space-files-from

Strip spaces from items read via --files-from
This commit is contained in:
Alexander Neumann 2018-02-11 21:35:23 +01:00
commit 2debb5c0e0
2 changed files with 8 additions and 1 deletions

View file

@ -0,0 +1,7 @@
Bugfix: Strip spaces for lines read via --files-from
Leading and trailing spaces in lines read via `--files-from` are now stripped,
so it behaves the same as with lines read via `--exclude-file`.
https://github.com/restic/restic/issues/1590
https://github.com/restic/restic/pull/1613

View file

@ -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