]> ruderich.org/simon Gitweb - nsscash/nsscash.git/blobdiff - group.go
nsscash: add "ca" option for files
[nsscash/nsscash.git] / group.go
index 4ca213a0edfabc48fd7a95e4280509c4547c9d5c..66da8f00551e32de8272a5b02b2fdb7c4006039f 100644 (file)
--- a/group.go
+++ b/group.go
@@ -23,10 +23,10 @@ import (
        "encoding/binary"
        "fmt"
        "io"
+       "math"
        "sort"
        "strconv"
        "strings"
-       "math"
 
        "github.com/pkg/errors"
 )
@@ -68,6 +68,11 @@ func ParseGroups(r io.Reader) ([]Group, error) {
                t, err := s.ReadString('\n')
                if err != nil {
                        if err == io.EOF {
+                               if t != "" {
+                                       return nil, fmt.Errorf(
+                                               "no newline in last line: %q",
+                                               t)
+                               }
                                break
                        }
                        return nil, err