projects
/
p5sagit/p5-mst-13.2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
Re: [PATCH] HERE mark in regex
[p5sagit/p5-mst-13.2.git]
/
perlio.c
diff --git
a/perlio.c
b/perlio.c
index
7580f2a
..
ba932f3
100644
(file)
--- a/
perlio.c
+++ b/
perlio.c
@@
-1646,7
+1646,9
@@
PerlIOBase_read(PerlIO *f, void *vbuf, Size_t count)
while (count > 0)
{
SSize_t avail = PerlIO_get_cnt(f);
- SSize_t take = (count < avail) ? count : avail;
+ SSize_t take = 0;
+ if (avail > 0)
+ take = (count < avail) ? count : avail;
if (take > 0)
{
STDCHAR *ptr = PerlIO_get_ptr(f);