bug-gnulib
[Top][All Lists]
Advanced

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

[Bug-gnulib] ls.c bug with QUOTING_STYLE environment var (was: argmatch.


From: Paul Eggert
Subject: [Bug-gnulib] ls.c bug with QUOTING_STYLE environment var (was: argmatch.c cleanups)
Date: Thu, 21 Nov 2002 11:28:17 -0800

> From: Bruno Haible <address@hidden>
> Date: Thu, 21 Nov 2002 16:02:28 +0100 (CET)

> who uses the case insensitive functions (argcasematch,
> ARGCASEMATCH)? It looks like unnecessary bloat to me. And if someone
> actually uses it then we have a problem in multibyte locales

True.  The only use that I know of is in coreutils/src/ls.c's handling
of the QUOTING_STYLE environment variable.  And I don't know why ls.c
uses ARGCASEMATCH.  It's very curious, since it's not documented, and
the --quoting-style option does not use case-insensitive matching.  I
suspect it's a bug in ls.c (which I probably introduced in 1998;
sorry!); the obvious patch is enclosed below.

So it's fine with me if we remove argcasematch and friends.


2002-11-21  Paul Eggert  <address@hidden>

        * src/ls.c (decode_switches): Use case-sensitive matching to
        decode the QUOTING_STYLE environment variable.  This is more
        consistent with the documentation, and with --quoting-style.

--- src/ls.c    2002-11-20 23:31:16.880001000 -0800
+++ /tmp/ls.c   2002-11-21 11:22:44.163550972 -0800
@@ -1303,7 +1303,7 @@ decode_switches (int argc, char **argv)
     char const *q_style = getenv ("QUOTING_STYLE");
     if (q_style)
       {
-       int i = ARGCASEMATCH (q_style, quoting_style_args, quoting_style_vals);
+       int i = ARGMATCH (q_style, quoting_style_args, quoting_style_vals);
        if (0 <= i)
          set_quoting_style (NULL, quoting_style_vals[i]);
        else




reply via email to

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