Skip to content

Commit

Permalink
logic fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Mzack9999 committed Jun 4, 2024
1 parent 7e2ce6f commit 43b398d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions file/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -633,9 +633,9 @@ func IsEmpty(filename string) (bool, error) {

// Check if all read characters are spaces, null characters, new lines, or carriage returns
for i := 0; i < n; i++ {
if unicode.IsSpace(rune(buffer[i])) || buffer[i] == 0 || buffer[i] == '\n' || buffer[i] == '\r' {
return true, nil
if !unicode.IsSpace(rune(buffer[i])) && buffer[i] != 0 && buffer[i] != '\n' && buffer[i] != '\r' {
return false, nil
}
}
return false, nil
return true, nil
}

0 comments on commit 43b398d

Please sign in to comment.