[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: branch master updated: * info/info.c (get_initial_file), * info/info
From: |
Eli Zaretskii |
Subject: |
Re: branch master updated: * info/info.c (get_initial_file), * info/infodoc.c (info_get_info_help_node), * info/nodes.c (info_get_node_with_defaults): Use strcmp or strcasecmp instead of mbscasecmp in several cases where we do not care about case-insensitive matching with non-ASCII characters. |
Date: |
Thu, 19 Oct 2023 17:07:23 +0300 |
> From: Gavin Smith <gavinsmith0123@gmail.com>
> Date: Thu, 19 Oct 2023 14:10:56 +0100
> Cc: bug-texinfo@gnu.org
>
> On Thu, Oct 19, 2023 at 03:26:51PM +0300, Eli Zaretskii wrote:
> > > diff --git a/info/info.c b/info/info.c
> > > index 8ca4a17e58..d7a6afaa2c 100644
> > > --- a/info/info.c
> > > +++ b/info/info.c
> > > @@ -250,7 +250,7 @@ get_initial_file (int *argc, char ***argv, char
> > > **error)
> > > {
> > > /* If they say info info (or info -O info, etc.), show them
> > > info-stnd.texi. (Get info.texi with info -f info.) */
> > > - if ((*argv)[0] && mbscasecmp ((*argv)[0], "info") == 0)
> > > + if ((*argv)[0] && strcmp ((*argv)[0], "info") == 0)
> > > (*argv)[0] = "info-stnd";
> >
> > This could produce regressions on case-insensitive filesystems, where
> > we could have INFO.EXE, for example. Do we really no longer care
> > about those?
>
> (*argv)[0] here is not the name of the program but what was given on the
> command line. It should mean that "INFO.EXE info" works as before if
> "INFO.EXE" is the name of the info program, whereas "INFO.EXE INFO" wouldn't.
On MS-DOS and MS-Windows, argv[0] is usually NOT what the user types
on the command line, it's what the OS fills in, and it usually puts
there the full absolute file name of the executable.
> > > /* If the node not found was "Top", try again with different case. */
> > > - if (!node && (nodename && mbscasecmp (nodename, "Top") == 0))
> > > + if (!node && (nodename && strcasecmp (nodename, "Top") == 0))
> >
> > Are there no Info manuals that have "Top" with a different
> > letter-case?
>
> It is strcasecmp here, not strcmp. This should support other
> capitalisations, like "TOP" or "ToP".
Right, sorry. So I think it's good enough.