* syntax.c (read_one_line): Clear errno before using it. Don't
use the result of fgetc() if errno is EINTR.
Этот коммит содержится в:
родитель
0b2051a0c3
Коммит
6c821c8ad5
@ -1,3 +1,8 @@
|
|||||||
|
2001-12-21 Pavel Roskin <proski@gnu.org>
|
||||||
|
|
||||||
|
* syntax.c (read_one_line): Clear errno before using it. Don't
|
||||||
|
use the result of fgetc() if errno is EINTR.
|
||||||
|
|
||||||
2001-11-28 Andrew V. Samoilov <kai@cmail.ru>
|
2001-11-28 Andrew V. Samoilov <kai@cmail.ru>
|
||||||
|
|
||||||
* syntax.c (apply_rules_going_right): Fix crash for lines like
|
* syntax.c (apply_rules_going_right): Fix crash for lines like
|
||||||
|
@ -401,11 +401,12 @@ static int read_one_line (char **line, FILE * f)
|
|||||||
#else
|
#else
|
||||||
p = syntax_malloc (len);
|
p = syntax_malloc (len);
|
||||||
#endif
|
#endif
|
||||||
|
errno = 0;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
c = fgetc (f);
|
c = fgetc (f);
|
||||||
if (c == EOF) {
|
|
||||||
if (errno == EINTR)
|
if (errno == EINTR)
|
||||||
continue;
|
continue;
|
||||||
|
if (c == EOF) {
|
||||||
r = 0;
|
r = 0;
|
||||||
break;
|
break;
|
||||||
} else if (c == '\n') {
|
} else if (c == '\n') {
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user