Skip to content

Commit

Permalink
Merge branch 'master' of github.com:fredericlemoine/gotree
Browse files Browse the repository at this point in the history
  • Loading branch information
fredericlemoine committed Jul 4, 2024
2 parents b324e73 + 56d00aa commit 7dfcea6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion io/fileutils/readln.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,13 @@ func ReadUntilSemiColon(r *bufio.Reader) (string, error) {
line, isPrefix, err = r.ReadLine()
ln = append(ln, line...)
if len(ln) > 0 {
lastChar = ln[len(ln)-1]
i := len(ln) - 1
lastChar = ln[i]
// Test what last non-space character of the line is
for (lastChar == ' ' || lastChar == '\t') && i >= 0 {
i--
lastChar = ln[i]
}
}
}
return string(ln), err
Expand Down
1 change: 1 addition & 0 deletions test.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
########## Test Suite for Gotree command line tools ##############

set -e
Expand Down

0 comments on commit 7dfcea6

Please sign in to comment.