/* vfgets.c - virtual fgets */
if ((pp
= malloc ((unsigned) (len
= BUFSIZ
))) == NULL
)
adios (NULLCP
, "unable to allocate string storage");
for (ep
= (cp
= pp
) + len
- 1;;) {
if (fgets (cp
, ep
- cp
+ 1, in
) == NULL
) {
return (ferror (in
) ? NOTOK
: DONE
);
if ((dp
= cp
+ strlen (cp
) - 2) < cp
|| *dp
!= QUOTE
) {
adios (NULLCP
, "vfgets() botch -- you lose big");
for (fp
= dp
- 1, toggle
= 0; fp
>= cp
; fp
--)
register int curlen
= cp
- pp
;
if ((dp
= realloc (pp
, (unsigned) (len
+= BUFSIZ
))) == NULL
)
adios (NULLCP
, "unable to allocate string storage");
cp
= dp
+ curlen
, ep
= (pp
= dp
) + len
- 1;