]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
build: update gnulib submodule to latest
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 12 Jun 2021 00:41:37 +0000 (17:41 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 12 Jun 2021 01:05:57 +0000 (18:05 -0700)
Coreutils mistakenly did not list xstrndup as a module
that it depends on directly.  When the latest Gnulib removed
the dirname module's dependency on xstrndup, this mistake
caused coreutils to not build.  Since all of Coreutils's
uses of xstrndup know the string length, xmemdup0 is a better
match for what's needed.  Since the size args are typically
signed or derived from subtracting pointers, the new Gnulib
ximemdup0 function is a better match yet.
So, use ximemdup0 instead of xstrndup.
* src/cut.c, src/dircolors.c, src/expand-common.c, src/expand.c:
* src/numfmt.c, src/set-fields.c, src/unexpand.c:
Do not include xstrndup.h; no longer needed.
* src/dircolors.c (parse_line):
* src/expand-common.c (parse_tab_stops):
* src/numfmt.c (parse_format_string):
* src/set-fields.c (set_fields):
Use ximemdup0 instead of xstrndup.

gnulib
src/cut.c
src/dircolors.c
src/expand-common.c
src/expand.c
src/numfmt.c
src/set-fields.c
src/unexpand.c

diff --git a/gnulib b/gnulib
index 1a72950760b1fce763ff834de0d545caab8a983c..ff7c8b21e259fdc4bc721ed55519cfee06739efa 160000 (submodule)
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit 1a72950760b1fce763ff834de0d545caab8a983c
+Subproject commit ff7c8b21e259fdc4bc721ed55519cfee06739efa
index 4189dcfd0ff52f113e1a6338b9b72a90cc363236..78b82c80e51b76769e7e778f23ddf4f3b660708d 100644 (file)
--- a/src/cut.c
+++ b/src/cut.c
@@ -34,7 +34,6 @@
 #include "fadvise.h"
 #include "getndelim2.h"
 #include "hash.h"
-#include "xstrndup.h"
 
 #include "set-fields.h"
 
index a1ab81bc8ef9d4b1ba04fa7288a35d1ab4f91516..fea0cdf018880f1b36bd0276ccf9ea9e018b65e7 100644 (file)
@@ -29,7 +29,6 @@
 #include "obstack.h"
 #include "quote.h"
 #include "stdio--.h"
-#include "xstrndup.h"
 
 /* The official name of this program (e.g., no 'g' prefix).  */
 #define PROGRAM_NAME "dircolors"
@@ -163,7 +162,7 @@ parse_line (char const *line, char **keyword, char **arg)
       ++p;
     }
 
-  *keyword = xstrndup (keyword_start, p - keyword_start);
+  *keyword = ximemdup0 (keyword_start, p - keyword_start);
   if (*p  == '\0')
     return;
 
@@ -185,7 +184,7 @@ parse_line (char const *line, char **keyword, char **arg)
     continue;
   ++p;
 
-  *arg = xstrndup (arg_start, p - arg_start);
+  *arg = ximemdup0 (arg_start, p - arg_start);
 }
 
 /* FIXME: Write a string to standard out, while watching for "dangerous"
index 82fce3b789cc08b3c676ef292cdef40f1b2d84dd..55df8dc0fd71e6e03e9ce986f11606cdabd89939 100644 (file)
@@ -24,7 +24,6 @@
 #include "error.h"
 #include "fadvise.h"
 #include "quote.h"
-#include "xstrndup.h"
 
 #include "expand-common.h"
 
@@ -200,7 +199,7 @@ parse_tab_stops (char const *stops)
           if (!DECIMAL_DIGIT_ACCUMULATE (tabval, *stops - '0', uintmax_t))
             {
               size_t len = strspn (num_start, "0123456789");
-              char *bad_num = xstrndup (num_start, len);
+              char *bad_num = ximemdup0 (num_start, len);
               error (0, 0, _("tab stop is too large %s"), quote (bad_num));
               free (bad_num);
               ok = false;
index 56fe27a53d6be8ff3b49fa15e4120c96026f8edf..dd9d2981a6c0df65e22b2838f0fd766c7d371341 100644 (file)
@@ -39,7 +39,6 @@
 #include <sys/types.h>
 #include "system.h"
 #include "die.h"
-#include "xstrndup.h"
 
 #include "expand-common.h"
 
index c54f96d27be792af041fe5238b40281ca9d6253b..fda03b4ddf411e7012e80e92bf0d744225bfc673 100644 (file)
@@ -29,7 +29,6 @@
 #include "quote.h"
 #include "system.h"
 #include "xstrtol.h"
-#include "xstrndup.h"
 
 #include "set-fields.h"
 
@@ -1141,7 +1140,7 @@ parse_format_string (char const *fmt)
            quote (fmt));
 
   if (prefix_len)
-    format_str_prefix = xstrndup (fmt, prefix_len);
+    format_str_prefix = ximemdup0 (fmt, prefix_len);
   if (fmt[suffix_pos] != '\0')
     format_str_suffix = xstrdup (fmt + suffix_pos);
 
index 320a16ba891e4743a2df027d0d1d55216cade8ce..42f6c218972fa20add83f22905a923ad8fcb16e0 100644 (file)
@@ -21,7 +21,6 @@
 #include "system.h"
 #include "error.h"
 #include "quote.h"
-#include "xstrndup.h"
 #include "set-fields.h"
 
 /* Array of `struct field_range_pair' holding all the finite ranges. */
@@ -254,7 +253,7 @@ set_fields (char const *fieldstr, unsigned int options)
                  complain only about the first number.  */
               /* Determine the length of the offending number.  */
               size_t len = strspn (num_start, "0123456789");
-              char *bad_num = xstrndup (num_start, len);
+              char *bad_num = ximemdup0 (num_start, len);
               error (0, 0, (options & SETFLD_ERRMSG_USE_POS)
                            ?_("byte/character offset %s is too large")
                            :_("field number %s is too large"),
index 697623080859203ca153bf9a1a9de0f9c3b04a0f..db0b74f240c5c734d66e7dda5273bdde1a8188b0 100644 (file)
@@ -40,7 +40,6 @@
 #include <sys/types.h>
 #include "system.h"
 #include "die.h"
-#include "xstrndup.h"
 
 #include "expand-common.h"