1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-12-16 09:01:25 +01:00

42469: necessary repairs to 42465 found by "make check"

This commit is contained in:
Stephane Chazelas 2018-03-18 16:49:42 -07:00 committed by Barton E. Schaefer
parent 1219eae829
commit d2350a1e80
3 changed files with 7 additions and 4 deletions

View file

@ -1,3 +1,7 @@
2018-03-18 Barton E. Schaefer <schaefer@brasslantern.com>
* Stephane: 42469: Src/exec.c, Src/Modules/mapfile.c: fix 42465
2018-03-15 Peter Stephenson <p.stephenson@samsung.com>
* Stephane: 42465: Src/exec.c, Src/Modules/mapfile.c: pass error

View file

@ -197,9 +197,8 @@ get_contents(char *fname)
val = NULL;
if ((fd = open(fname, O_RDONLY | O_NOCTTY)) >= 0) {
LinkList ll;
int readerror;
if ((ll = readoutput(fd, 1, &readerror)))
if ((ll = readoutput(fd, 1, 0)))
val = peekfirst(ll);
}
#endif /* USE_MMAP */

View file

@ -4599,8 +4599,8 @@ readoutput(int in, int qt, int *readerror)
}
*ptr++ = c;
}
if (readerror && ferror(fin))
*readerror = errno;
if (readerror)
*readerror = ferror(fin) ? errno : 0;
fclose(fin);
while (cnt && ptr[-1] == '\n')
ptr--, cnt--;