Home | Info | Community | Development | myReactOS | Contact Us
[static]
Definition at line 186 of file adh-main.c.
{ int anydone, r; char *newline, *space; anydone= 0; while (!anydone || used) { while (!(newline= memchr(buf,'\n',used))) { if (used == avail) { avail += 20; avail <<= 1; buf= realloc(buf,avail); if (!buf) sysfail("realloc stdin buffer",errno); } do { r= read(0,buf+used,avail-used); } while (r < 0 && errno == EINTR); if (r == 0) { if (used) { /* fake up final newline */ buf[used++]= '\n'; r= 1; } else { ov_pipe= 0; return; } } if (r < 0) sysfail("read stdin",errno); used += r; } *newline++= 0; space= strchr(buf,' '); if (space) *space++= 0; process_optarg(buf,0,space); used -= (newline-buf); memmove(buf,newline,used); anydone= 1; } }