bug-textutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH]: bad interaction between head(1) and pipes


From: ian . bruce . nospam
Subject: Re: [PATCH]: bad interaction between head(1) and pipes
Date: Sat, 18 Aug 2001 10:37:19 -0700

You wrote:

>Thanks a lot for the report and patch!
>I've applied it with a minor change; diff below.
>
>BTW, it's not just with pipes:
>
>  $ echo abc > x
>  $ (./head -c1; ./head -c1) < x
>  ab$
>
>The above is with the fixed version.
>Without your fix, the output would be just `a'.

I hadn't thought of that, but it makes sense. The shell just dup2()'s
the open file descriptor onto the standard input of each successive
child process.

>+  size_t bytes_to_read = BUFSIZE;

Shouldn't bytes_to_read, bytes_to_write, and bytes_read all be of type
size_t?


-- Ian Bruce  <ian dot bruce at myrealbox dot com>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]