diff options
author | Charles Bailey <bailey@newman.upenn.edu> | 1999-09-29 02:21:31 +0000 |
---|---|---|
committer | bailey <bailey@newman.upenn.edu> | 1999-09-29 02:21:31 +0000 |
commit | c529f79d594c53d3968d464c57ac24a21137dd09 (patch) | |
tree | 1a391a0c329976fd8ae88a240da31051b926c681 /djgpp/djgpp.c | |
parent | 424a8fe95d507998fe8750793da1b35bd6d7074b (diff) | |
download | perl-c529f79d594c53d3968d464c57ac24a21137dd09.tar.gz |
resync with mainline
p4raw-id: //depot/vmsperl@4249
Diffstat (limited to 'djgpp/djgpp.c')
-rw-r--r-- | djgpp/djgpp.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/djgpp/djgpp.c b/djgpp/djgpp.c index 5c1d3c4de4..5a8fc5fa5c 100644 --- a/djgpp/djgpp.c +++ b/djgpp/djgpp.c @@ -123,7 +123,7 @@ convretcode (pTHX_ int rc,char *prog,int fl) Perl_warner(aTHX_ WARN_EXEC,"Can't %s \"%s\": %s", fl ? "exec" : "spawn",prog,Strerror (errno)); if (rc > 0) - return rc <<= 8; + return rc << 8; if (rc < 0) return 255 << 8; return 0; @@ -252,6 +252,7 @@ struct globinfo int fd; char *matches; size_t size; + fpos_t pos; }; #define MAXOPENGLOBS 10 @@ -286,6 +287,7 @@ glob_handler (__FSEXT_Fnumber n,int *rv,va_list args) if ((gi=searchfd (-1)) == NULL) break; + gi->pos=0; pattern=alloca (strlen (name+=13)+1); strcpy (pattern,name); if (!_USE_LFN) @@ -332,11 +334,10 @@ glob_handler (__FSEXT_Fnumber n,int *rv,va_list args) if ((gi=searchfd (fd))==NULL) break; - ic=tell (fd); - if (siz+ic>=gi->size) - siz=gi->size-ic; - memcpy (buf,ic+gi->matches,siz); - lseek (fd,siz,1); + if (siz+gi->pos > gi->size) + siz = gi->size - gi->pos; + memcpy (buf,gi->pos+gi->matches,siz); + gi->pos += siz; *rv=siz; return 1; } |