Skip to content

Commit 60ae0c5

Browse files
committed
Fix issue 1
1 parent 5de4645 commit 60ae0c5

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

input.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ func readFile(file string, ignoreAttr []string, queue chan<- []string, wg *sync.
117117
if strings.HasPrefix(line, "version: ") {
118118
firstLine = false
119119
continue
120+
} else if line == "" {
121+
continue
120122
}
121123
firstLine = false
122124
}
@@ -158,9 +160,7 @@ func readStr(ldifStr string, ignoreAttr []string, queue chan<- []string, wg *syn
158160
continue
159161
}
160162

161-
// Check if first "record" is a "version: *" line and skip it
162-
// TODO: version and dn on some record
163-
if idx == 0 {
163+
if idx == 0 { // First record only
164164
if strings.HasPrefix(line, "version: ") {
165165
continue
166166
}

t/source.ldif

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# LDIF ends with an empty line
2-
# A comment
1+
version: 1
2+
33
dn: identical,ou=aAccounts,dc=domain,dc=ext
44
sambaSID: A samba id something
55
eduPersonEntitlement: urn:mace:domain.ext:en

0 commit comments

Comments
 (0)