coreutils
[Top][All Lists]
Advanced

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

FYI: two small diffs


From: Jim Meyering
Subject: FYI: two small diffs
Date: Thu, 23 Jun 2022 08:39:02 -0700

I've just pushed these two small changes:

>From 7e6c39cc02f461c45ef51544a512a40791d6d603 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@fb.com>
Date: Thu, 23 Jun 2022 08:07:18 -0700
Subject: [PATCH 1/2] maint: remove unnecessary inclusion of hash.h

* src/cut.c: Don't include hash.h. The implementation was
changed not to need that in v8.21-43-g3e466ad05.
---
 src/cut.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/cut.c b/src/cut.c
index 6fd8978a6..2a45eedff 100644
--- a/src/cut.c
+++ b/src/cut.c
@@ -33,7 +33,6 @@
 #include "error.h"
 #include "fadvise.h"
 #include "getndelim2.h"
-#include "hash.h"

 #include "set-fields.h"

-- 
2.35.1.677.gabf474a5dd


>From 6c03e8fbb25d52b5fda62a95090568f0ba5fca70 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@fb.com>
Date: Thu, 23 Jun 2022 07:33:08 -0700
Subject: [PATCH 2/2] cp: avoid -Wmaybe-uninitialized warning from GCC13

* src/copy.c (infer_scantype): Always set scan_inference.ext_start,
to make the code match the comment.
---
 src/copy.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/copy.c b/src/copy.c
index edc822134..0c368d0e4 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -1045,7 +1045,10 @@ infer_scantype (int fd, struct stat const *sb,
   if (! (HAVE_STRUCT_STAT_ST_BLOCKS
          && S_ISREG (sb->st_mode)
          && ST_NBLOCKS (*sb) < sb->st_size / ST_NBLOCKSIZE))
-    return PLAIN_SCANTYPE;
+    {
+      scan_inference->ext_start = -1;
+      return PLAIN_SCANTYPE;
+    }

 #ifdef SEEK_HOLE
   scan_inference->ext_start = lseek (fd, 0, SEEK_DATA);
@@ -1053,6 +1056,8 @@ infer_scantype (int fd, struct stat const *sb,
     return LSEEK_SCANTYPE;
   else if (errno != EINVAL && !is_ENOTSUP (errno))
     return ERROR_SCANTYPE;
+#else
+  scan_inference->ext_start = -1;
 #endif

   return ZERO_SCANTYPE;
-- 
2.35.1.677.gabf474a5dd


reply via email to

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