Only remove the '\n' at the end of a line if there is one.
I missed this as part of the fix to the PR below. PR: 31265 Submitted by: Matthew D. Fuller <fullermd@over-yonder.net> MFC after: 1 week
This commit is contained in:
parent
a983fdfe4c
commit
879e98b647
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=94389
@ -392,7 +392,8 @@ in_file(string, file)
|
||||
rewind(file);
|
||||
while (fgets(line, MAX_TEMPSTR, file)) {
|
||||
if (line[0] != '\0')
|
||||
line[strlen(line)-1] = '\0';
|
||||
if (line[strlen(line)-1] == '\n')
|
||||
line[strlen(line)-1] = '\0';
|
||||
if (0 == strcmp(line, string))
|
||||
return TRUE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user