[Top][All Lists]

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

grep branch, master, updated. v3.4-almost-31-gb6d95a4

From: Paul Eggert
Subject: grep branch, master, updated. v3.4-almost-31-gb6d95a4
Date: Fri, 18 Sep 2020 16:41:32 -0400 (EDT)

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  b6d95a4e6b57cd260040fb83f828e81b01acd720 (commit)
      from  203ad5b718ce349efa6bfa847b356d47dc5c584e (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 b6d95a4e6b57cd260040fb83f828e81b01acd720
Author: Paul Eggert <>
Date:   Fri Sep 18 13:40:58 2020 -0700

    grep: tweak by using mempcpy
    * src/grep.c (try_fgrep_pattern): Tweak previous change
    by using mempcpy.

diff --git a/src/grep.c b/src/grep.c
index 497780e..d1ea5da 100644
--- a/src/grep.c
+++ b/src/grep.c
@@ -2470,10 +2470,8 @@ try_fgrep_pattern (int matcher, char *keys, size_t 
   if (*len_p != p - new_keys)
       *len_p = p - new_keys;
-      memcpy (keys, new_keys, p - new_keys);
-      /* We have just shortened this pattern.
-         Preserve the invariant that it is newline-terminated.  */
-      keys[*len_p] = '\n';
+      char *keys_end = mempcpy (keys, new_keys, p - new_keys);
+      *keys_end = '\n';
   result = F_MATCHER_INDEX;


Summary of changes:
 src/grep.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)


reply via email to

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