]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
stat: change default quoting from shell-escape-always to shell-escape
authorPádraig Brady <P@draigBrady.com>
Wed, 3 Jun 2026 15:31:39 +0000 (16:31 +0100)
committerPádraig Brady <P@draigBrady.com>
Thu, 4 Jun 2026 12:48:09 +0000 (13:48 +0100)
This should not affect programatic parsing, because if you have to parse
the shell style, then the same logic will parse unescaped output.
This is a better default now that --terse uses quoted format by default,
and also the default output format quotes file names by default.

* src/stat.c (getenv_quoting_style): Change the default.

doc/coreutils.texi
src/stat.c

index 33c7f19594a960dae33a939290ae33ecebc505d6..a0b4cd9cf79a0bedb13b884ea658a079cdfbced4 100644 (file)
@@ -12600,7 +12600,7 @@ numbers unambiguously octal, you can use @samp{%#03a}.
 
 The @samp{%N} and @samp{%Qn} formats can be set with the environment variable
 @env{QUOTING_STYLE}@.  If that environment variable is not set,
-the default value is @samp{shell-escape-always}.  Valid quoting styles are:
+the default value is @samp{shell-escape}.  Valid quoting styles are:
 @quotingStyles
 
 The @samp{r}, @samp{R}, @samp{%t}, and @samp{%T} formats operate on the st_rdev
index c76f4880a782c1a5eee74be8d5bd70dbfa33418f..77ea54cdeba52fac5f556666ebb3bd0431769742 100644 (file)
@@ -874,13 +874,13 @@ getenv_quoting_style (void)
         set_quoting_style (NULL, quoting_style_vals[i]);
       else
         {
-          set_quoting_style (NULL, shell_escape_always_quoting_style);
+          set_quoting_style (NULL, shell_escape_quoting_style);
           error (0, 0, _("ignoring invalid value of environment "
                          "variable QUOTING_STYLE: %s"), quote (q_style));
         }
     }
   else
-    set_quoting_style (NULL, shell_escape_always_quoting_style);
+    set_quoting_style (NULL, shell_escape_quoting_style);
 }
 
 /* Equivalent to quotearg(), but explicit to avoid syntax checks.  */