From the PR:
The PCCard daemon can hang indefinately while reading its configuration file. If the last line of the file is a comment line that does not end in a newline, the program goes into an infinite loop searching for the non-existent newline. This fix, provided by the PR, will allow files ending without a newline to be read without hanging. Submitted by: Crist J. Clark <cjclark@alum.mit.edu> PR: bin/25791
This commit is contained in:
parent
6a40ef8254
commit
eae79da24b
@ -836,10 +836,8 @@ get(void)
|
||||
}
|
||||
if (c == '\n')
|
||||
lineno++;
|
||||
if (c == '#') {
|
||||
while (get() != '\n');
|
||||
return (last_char = '\n');
|
||||
}
|
||||
if (c == '#')
|
||||
while (((c = get()) != '\n') && (c != EOF));
|
||||
return (last_char = c);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user