Skip to content

Commit

Permalink
for comment end --> check added, instead of ->
Browse files Browse the repository at this point in the history
  • Loading branch information
LIJUCHACKO committed Feb 3, 2022
1 parent 2d48c7c commit 67a53e0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions xmlAsDB.go
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ func parseAndLoadXml(DB *Database, content string) []int {
}
if content[index] == '>' {
if CommentStarted {
if content[index-1] == '-' {
if ((content[index-1] == '-') && (content[index-2] == '-')) {
//comparestringBackward(line, "->")
CommentStarted = false
buffer := content[lastindex : index+1]
Expand All @@ -776,7 +776,7 @@ func parseAndLoadXml(DB *Database, content string) []int {
}
} else if CDATAStarted {
//comparestringBackward(line, "]]>")
if content[index-1] == ']' {
if ((content[index-1] == ']') && (content[index-2] == ']')) {
buffer := content[lastindex : index+1]
lastindex = index + 1
if len(strings.TrimSpace(buffer)) > 0 {
Expand Down Expand Up @@ -1448,12 +1448,12 @@ func validatexml(content string) bool {
}
if content[index] == '>' {
if CommentStarted {
if content[index-1] == '-' {
if ((content[index-1] == '-') && (content[index-2] == '-')) {
CommentStarted = false
lastindex = index + 1
}
} else if CDATAStarted {
if content[index-1] == ']' {
if ((content[index-1] == ']') && (content[index-2] == ']')) {
lastindex = index + 1
CDATAStarted = false
}
Expand Down

0 comments on commit 67a53e0

Please sign in to comment.