forked from TrueCloudLab/restic
Merge pull request #1613 from restic/strip-space-files-from
Strip spaces from items read via --files-from
This commit is contained in:
commit
2debb5c0e0
2 changed files with 8 additions and 1 deletions
7
changelog/0.8.2/issue-1590
Normal file
7
changelog/0.8.2/issue-1590
Normal 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
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue