On 20 September 2013 14:16, Glenn Fowler <[email protected]> wrote:
>
> this was an interesting diversion
> a text file with size>0 and newline!=last-char has an incomplete line
> the head and tail descriptions do not mention incomplete lines
> but head has some text that is equivalent to "incomplete line counts as a 
> line":
>
>     When a file contains less than number lines, it shall be copied
>     to standard output in its entirety. This shall not be an error.
>
> for consistency tail should treat incomplete lines the same way head does
>
> given that, both the current ast head and ast tail are inconsistent w.r.t. 
> incomplete lines
>
> head was easy to fix by implementing the "entirety" text above
> tail was a bit more interesting because it if revealed a bug in 
> sfmove(from,to,size,record_sep)
> when record_sep is '\n' -- it loses the data for an incomplete line
> fixing tail involved checking if sfmove() hit an incomplete line and
> then calling sfmove(...,-1) to move all remaining *and* fixing sfmove(...,-1)
> to recognize that an incomplete line was hit
>
> regression tests were added to src/cmd/builtin and now head and tail align 
> with gnu
>
> from what I can tell the standard conformance tests completely miss this issue
>
> this will be in the next alpha
> and that will be early next week

Glenn, could you send the patch to the list so that we can test it, please?

Ced
-- 
Cedric Blancher <[email protected]>
Institute Pasteur
_______________________________________________
ast-developers mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-developers

Reply via email to