GNU bug report logs - #17145
head fails with implicit stdin on darwin

Previous Next

Package: coreutils;

Reported by: Denis Excoffier <gcc <at> Denis-Excoffier.org>

Date: Sun, 30 Mar 2014 21:44:02 UTC

Severity: normal

Tags: patch

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


Message #25 received at 17145 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 17145 <at> debbugs.gnu.org, Denis Excoffier <gcc <at> Denis-Excoffier.org>
Subject: Re: bug#17145: head fails with implicit stdin on darwin
Date: Tue, 01 Apr 2014 00:14:04 +0100
Very nice cleanup. Comments below...

On 03/31/2014 08:43 PM, Paul Eggert wrote:
> diff --git a/NEWS b/NEWS

> +  head no longer assumes that lseek fails on unseekable devices.
> +  [bug introduced with the --bytes=-N feature in coreutils-5.0.1]

I slightly prefer my NEWS entry since it details the consequences
rather than the mechanism, and so could be more meaningful to end users.

> @@ -833,14 +802,24 @@ head (const char *filename, int fd, uintmax_t n_units, bool count_lines,
>  
>    if (elide_from_end)
>      {
> -      if (count_lines)
> +      off_t current_pos = -1, size = -1;
> +      if (! presume_input_pipe)
>          {
> -          return elide_tail_lines_file (filename, fd, n_units);
> +          struct stat st;
> +          if (fstat (fd, &st) != 0)
> +            error (0, errno, _("cannot fstat %s"), quotearg_colon (filename));
> +          if (S_ISREG (st.st_mode))

s/if/else if/

Could you also update Denis' current email address in THANKS.in

Otherwise it all looks good.

thanks!
Pádraig.




This bug report was last modified 11 years and 54 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.