2
2
mirror of https://github.com/octoleo/restic.git synced 2024-12-22 02:48:55 +00:00

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.
This commit is contained in:
Alexander Neumann 2018-02-11 20:56:11 +01:00
parent 7f0d964a05
commit c5575c7ed9

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