]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
build: cut: fix compilation error on non C23 compilers
authorPádraig Brady <P@draigBrady.com>
Mon, 6 Apr 2026 21:35:39 +0000 (22:35 +0100)
committerPádraig Brady <P@draigBrady.com>
Mon, 6 Apr 2026 21:37:15 +0000 (22:37 +0100)
* src/cut.c (main): Add curly brackets around variable
declaration in case label.
Reported by Bruno Haible.

src/cut.c

index 4df933bf94e960accc89d80734f03e5c54e4b9f1..eb82c04494bf0f914865513925559e7c0d208f72 100644 (file)
--- a/src/cut.c
+++ b/src/cut.c
@@ -1317,14 +1317,16 @@ main (int argc, char **argv)
           break;
 
         case 'd':
-          /* New delimiter.  */
-          /* Interpret -d '' to mean 'use the NUL byte as the delimiter.'  */
-          mcel_t g = delim_mcel = mcel_scanz (optarg);
-          if (optarg[0] && optarg[g.len])
-            FATAL_ERROR (_("the delimiter must be a single character"));
-          copy_bytes (delim_bytes, optarg, g.len);
-          delim_specified = true;
-          break;
+          {
+            /* New delimiter.  */
+            /* Interpret -d '' to mean 'use the NUL byte as the delimiter.'  */
+            mcel_t g = delim_mcel = mcel_scanz (optarg);
+            if (optarg[0] && optarg[g.len])
+              FATAL_ERROR (_("the delimiter must be a single character"));
+            copy_bytes (delim_bytes, optarg, g.len);
+            delim_specified = true;
+            break;
+          }
 
         case 'w':
           whitespace_delimited = true;