[PATCH v2: setxkbmap 1/3] Bug 34117: setxkbmap -I dir not accepted, despite man page

Dirk Wallenstein halsmit at t-online.de
Sat Feb 12 01:00:19 PST 2011


On Thu, Feb 10, 2011 at 11:01:57PM -0800, Alan Coopersmith wrote:
> Easy enough to accept the syntax documented in the man page, so accept
> the -I flag with or without a space between -I and the directory argument.
> 
> https://bugs.freedesktop.org/show_bug.cgi?id=34117
> 
> Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
> ---
> 
> Updated to just warn & ignore as the other options do when no argument is
> given, as suggested in:
>        https://bugs.freedesktop.org/show_bug.cgi?id=34117#c4
> 
>  setxkbmap.c |   10 +++++++++-
>  1 files changed, 9 insertions(+), 1 deletions(-)
> 
> diff --git a/setxkbmap.c b/setxkbmap.c
> index e812a9c..511659b 100644
> --- a/setxkbmap.c
> +++ b/setxkbmap.c
> @@ -414,7 +414,15 @@ parseArgs(int argc, char **argv)
>              usage(argc, argv);
>              exit(0);
>          }
> -        else if (strpfx(argv[i], "-I"))
> +        else if (streq(argv[i], "-I")) /* space between -I and path */
> +        {
> +            if ( ++i < argc )
> +                ok = addToList(&szInclPath, &numInclPath, &inclPath, argv[i]);
> +            else
> +                VMSG(0, "No directory specified on the command line\n"
> +		     "Trailing -I option ignored\n");

Indentation introduces tabs

> +        }
> +        else if (strpfx(argv[i], "-I")) /* no space between -I and path */
>              ok = addToList(&szInclPath, &numInclPath, &inclPath, &argv[i][2]);
>          else if (streq(argv[i], "-keycodes"))
>              ok = setOptString(&i, argc, argv, KEYCODES_NDX, FROM_CMD_LINE);
> -- 
> 1.7.3.2
> 

Reviewed-by: Dirk Wallenstein <halsmit at t-online.de>

-- 
Greetings,
Dirk


More information about the xorg-devel mailing list