[Top][All Lists]

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

grep branch, master, updated. v2.26-7-g39ee80d

From: Jim Meyering
Subject: grep branch, master, updated. v2.26-7-g39ee80d
Date: Fri, 21 Oct 2016 06:29:36 +0000 (UTC)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grep".

The branch, master has been updated
       via  39ee80d53f41b05ef1f483363e8e535db8137f90 (commit)
      from  899b5189ec67bdefd2e294307a9be80de757583e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------

commit 39ee80d53f41b05ef1f483363e8e535db8137f90
Author: Zev Weiss <address@hidden>
Date:   Sun Oct 16 01:14:51 2016 -0500

    grep: use 'j' intmax_t printf length modifier if supported
    * Use gl_PRINTF_SIZES_C99 to test printf and
    (conditionally) define HAVE_PRINTF_C99_SIZES.
    * src/grep.c (print_offset): Use printf("%j...") for printing
    [u]intmax_t if HAVE_PRINTF_C99_SIZES is defined; otherwise continue
    using the existing hand-rolled loop.

diff --git a/ b/
index 8a20317..0dd4d84 100644
--- a/
+++ b/
@@ -206,6 +206,12 @@ fi
+if test "$gl_cv_func_printf_sizes_c99" = yes; then
+    [Define to 1 if printf formats %j, %z, %t and %L work.])
 case $host_os in
   mingw*) suffix=w32 ;;
   *) suffix=posix ;;
diff --git a/src/grep.c b/src/grep.c
index f7cadfb..1163eae 100644
--- a/src/grep.c
+++ b/src/grep.c
@@ -1074,6 +1074,7 @@ print_sep (char sep)
 static void
 print_offset (uintmax_t pos, int min_width, const char *color)
   /* Do not rely on printf to print pos, since uintmax_t may be longer
      than long, and long long is not portable.  */
@@ -1091,9 +1092,14 @@ print_offset (uintmax_t pos, int min_width, const char 
   if (align_tabs)
     while (--min_width >= 0)
       *--p = ' ';
+#endif /* !HAVE_PRINTF_C99_SIZES */
   pr_sgr_start_if (color);
+  printf_errno ("%*ju", align_tabs ? min_width : 0, pos);
   fwrite_errno (p, 1, buf + sizeof buf - p);
   pr_sgr_end_if (color);


Summary of changes: |    6 ++++++
 src/grep.c   |    6 ++++++
 2 files changed, 12 insertions(+)


reply via email to

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