summaryrefslogtreecommitdiff
path: root/app/xkill
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2018-05-21 17:50:15 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2018-05-21 17:50:15 +0000
commit48855738f1c52dd3dcde5b866bce8ef944f3407b (patch)
tree9525462bb4e50c31f744dad538343ab63b74dc2a /app/xkill
parentb8285599636e98ef2aced5adcac16858b7d32ce9 (diff)
Update to xkill 1.0.5
Diffstat (limited to 'app/xkill')
-rw-r--r--app/xkill/ChangeLog75
-rw-r--r--app/xkill/aclocal.m464
-rw-r--r--app/xkill/compile2
-rw-r--r--app/xkill/configure86
-rw-r--r--app/xkill/configure.ac2
-rw-r--r--app/xkill/xkill.c38
6 files changed, 197 insertions, 70 deletions
diff --git a/app/xkill/ChangeLog b/app/xkill/ChangeLog
index 8089e9572..97140ec99 100644
--- a/app/xkill/ChangeLog
+++ b/app/xkill/ChangeLog
@@ -1,3 +1,78 @@
+commit a2fdd07e3688e658d3af31dc3780983432de31e4
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Fri Mar 9 17:48:32 2018 -0800
+
+ xkill 1.0.5
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit b3538a31ba88b865b1c5aafe4b8e798f6f04e26d
+Author: Mihail Konev <k.mvc@ya.ru>
+Date: Thu Jan 26 14:00:21 2017 +1000
+
+ autogen: add default patch prefix
+
+ Signed-off-by: Mihail Konev <k.mvc@ya.ru>
+
+commit 19c1509c183215dc10b3682d4a68b2e25cb12c47
+Author: Emil Velikov <emil.l.velikov@gmail.com>
+Date: Mon Mar 9 12:00:52 2015 +0000
+
+ autogen.sh: use quoted string variables
+
+ Place quotes around the $srcdir, $ORIGDIR and $0 variables to prevent
+ fall-outs, when they contain space.
+
+ Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
+ Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit e0dae86d008315d637770008c3a3ac1e11292f14
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date: Tue Jan 24 10:32:07 2017 +1000
+
+ autogen.sh: use exec instead of waiting for configure to finish
+
+ Syncs the invocation of configure with the one from the server.
+
+ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+ Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
+
+commit 7942cfdb5fad5c6fe9d2d9c622f080b4c52b0c97
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Thu Apr 23 22:53:54 2015 -0700
+
+ Use strcasecmp instead of a tolower loop & strcmp
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ Reviewed-by: Matthieu Herrb <matthieu@herrb.eu>
+
+commit 3115919a3bbb230b541b5ad8ccd2e363b8a4e4ab
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sat May 31 22:11:39 2014 -0700
+
+ Print which option was in error along with usage message
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit b0970c3a99f8aeefe2f9890e87dabc6a1dd16cf6
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sat May 31 22:02:51 2014 -0700
+
+ autogen.sh: Honor NOCONFIGURE=1
+
+ See http://people.gnome.org/~walters/docs/build-api.txt
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit f1147dcdc3d78fd91ef84cb538abc8aa28301de0
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sat May 31 22:02:42 2014 -0700
+
+ configure: Drop AM_MAINTAINER_MODE
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
commit 3d990ebfd1dde829f9fda86c556aa51a0308188b
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sun Sep 8 09:51:15 2013 -0700
diff --git a/app/xkill/aclocal.m4 b/app/xkill/aclocal.m4
index c0dbcfb1f..8bef9a948 100644
--- a/app/xkill/aclocal.m4
+++ b/app/xkill/aclocal.m4
@@ -1242,7 +1242,7 @@ AC_SUBST([am__untar])
dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure.
dnl
-dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+dnl Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
dnl
dnl Permission is hereby granted, free of charge, to any person obtaining a
dnl copy of this software and associated documentation files (the "Software"),
@@ -1279,7 +1279,7 @@ dnl DEALINGS IN THE SOFTWARE.
# See the "minimum version" comment for each macro you use to see what
# version you require.
m4_defun([XORG_MACROS_VERSION],[
-m4_define([vers_have], [1.19.0])
+m4_define([vers_have], [1.19.2])
m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
m4_if(m4_cmp(maj_have, maj_needed), 0,,
@@ -1357,6 +1357,17 @@ AC_DEFUN([XORG_MANPAGE_SECTIONS],[
AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([AC_PROG_SED])
+case $host_os in
+ solaris*)
+ # Solaris 2.0 - 11.3 use SysV man page section numbers, so we
+ # check for a man page file found in later versions that use
+ # traditional section numbers instead
+ AC_CHECK_FILE([/usr/share/man/man7/attributes.7],
+ [SYSV_MAN_SECTIONS=false], [SYSV_MAN_SECTIONS=true])
+ ;;
+ *) SYSV_MAN_SECTIONS=false ;;
+esac
+
if test x$APP_MAN_SUFFIX = x ; then
APP_MAN_SUFFIX=1
fi
@@ -1372,9 +1383,9 @@ if test x$LIB_MAN_DIR = x ; then
fi
if test x$FILE_MAN_SUFFIX = x ; then
- case $host_os in
- solaris*) FILE_MAN_SUFFIX=4 ;;
- *) FILE_MAN_SUFFIX=5 ;;
+ case $SYSV_MAN_SECTIONS in
+ true) FILE_MAN_SUFFIX=4 ;;
+ *) FILE_MAN_SUFFIX=5 ;;
esac
fi
if test x$FILE_MAN_DIR = x ; then
@@ -1382,9 +1393,9 @@ if test x$FILE_MAN_DIR = x ; then
fi
if test x$MISC_MAN_SUFFIX = x ; then
- case $host_os in
- solaris*) MISC_MAN_SUFFIX=5 ;;
- *) MISC_MAN_SUFFIX=7 ;;
+ case $SYSV_MAN_SECTIONS in
+ true) MISC_MAN_SUFFIX=5 ;;
+ *) MISC_MAN_SUFFIX=7 ;;
esac
fi
if test x$MISC_MAN_DIR = x ; then
@@ -1392,9 +1403,9 @@ if test x$MISC_MAN_DIR = x ; then
fi
if test x$DRIVER_MAN_SUFFIX = x ; then
- case $host_os in
- solaris*) DRIVER_MAN_SUFFIX=7 ;;
- *) DRIVER_MAN_SUFFIX=4 ;;
+ case $SYSV_MAN_SECTIONS in
+ true) DRIVER_MAN_SUFFIX=7 ;;
+ *) DRIVER_MAN_SUFFIX=4 ;;
esac
fi
if test x$DRIVER_MAN_DIR = x ; then
@@ -1402,9 +1413,9 @@ if test x$DRIVER_MAN_DIR = x ; then
fi
if test x$ADMIN_MAN_SUFFIX = x ; then
- case $host_os in
- solaris*) ADMIN_MAN_SUFFIX=1m ;;
- *) ADMIN_MAN_SUFFIX=8 ;;
+ case $SYSV_MAN_SECTIONS in
+ true) ADMIN_MAN_SUFFIX=1m ;;
+ *) ADMIN_MAN_SUFFIX=8 ;;
esac
fi
if test x$ADMIN_MAN_DIR = x ; then
@@ -1665,13 +1676,24 @@ m4_ifval([$1],
fi])
# Test for the ability of xmlto to generate a text target
+#
+# NOTE: xmlto 0.0.27 or higher return a non-zero return code in the
+# following test for empty XML docbook files.
+# For compatibility reasons use the following empty XML docbook file and if
+# it fails try it again with a non-empty XML file.
have_xmlto_text=no
cat > conftest.xml << "EOF"
EOF
AS_IF([test "$have_xmlto" = yes],
[AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
[have_xmlto_text=yes],
- [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
+ [# Try it again with a non-empty XML file.
+ cat > conftest.xml << "EOF"
+<x></x>
+EOF
+ AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
+ [have_xmlto_text=yes],
+ [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])])
rm -f conftest.xml
AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
@@ -3067,8 +3089,9 @@ AC_REQUIRE([PKG_PROG_PKG_CONFIG])
macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
-|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
-echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
+|| (rm -f \$(top_srcdir)/.INSTALL.tmp; test -e \$(top_srcdir)/INSTALL || ( \
+touch \$(top_srcdir)/INSTALL; \
+echo 'failed to copy INSTALL from util-macros: installing empty INSTALL.' >&2))"
AC_SUBST([INSTALL_CMD])
]) # XORG_INSTALL
dnl Copyright 2005 Red Hat, Inc
@@ -3129,10 +3152,11 @@ AC_DEFUN([XORG_RELEASE_VERSION],[
#
#
AC_DEFUN([XORG_CHANGELOG], [
-CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
+CHANGELOG_CMD="((GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp) 2>/dev/null && \
mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
-|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
-echo 'git directory not found: installing possibly empty changelog.' >&2)"
+|| (rm -f \$(top_srcdir)/.changelog.tmp; test -e \$(top_srcdir)/ChangeLog || ( \
+touch \$(top_srcdir)/ChangeLog; \
+echo 'git failed to create ChangeLog: installing empty ChangeLog.' >&2))"
AC_SUBST([CHANGELOG_CMD])
]) # XORG_CHANGELOG
diff --git a/app/xkill/compile b/app/xkill/compile
index 531136b06..a85b723c7 100644
--- a/app/xkill/compile
+++ b/app/xkill/compile
@@ -3,7 +3,7 @@
scriptversion=2012-10-14.11; # UTC
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
diff --git a/app/xkill/configure b/app/xkill/configure
index 4f2eeb077..937d61425 100644
--- a/app/xkill/configure
+++ b/app/xkill/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for xkill 1.0.4.
+# Generated by GNU Autoconf 2.69 for xkill 1.0.5.
#
# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
#
@@ -581,8 +581,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='xkill'
PACKAGE_TARNAME='xkill'
-PACKAGE_VERSION='1.0.4'
-PACKAGE_STRING='xkill 1.0.4'
+PACKAGE_VERSION='1.0.5'
+PACKAGE_STRING='xkill 1.0.5'
PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg'
PACKAGE_URL=''
@@ -1311,7 +1311,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures xkill 1.0.4 to adapt to many kinds of systems.
+\`configure' configures xkill 1.0.5 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1381,7 +1381,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of xkill 1.0.4:";;
+ short | recursive ) echo "Configuration of xkill 1.0.5:";;
esac
cat <<\_ACEOF
@@ -1489,7 +1489,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-xkill configure 1.0.4
+xkill configure 1.0.5
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1746,7 +1746,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by xkill $as_me 1.0.4, which was
+It was created by xkill $as_me 1.0.5, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2575,7 +2575,7 @@ fi
# Define the identity of the package.
PACKAGE='xkill'
- VERSION='1.0.4'
+ VERSION='1.0.5'
cat >>confdefs.h <<_ACEOF
@@ -10242,10 +10242,11 @@ _ACEOF
-CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
+CHANGELOG_CMD="((GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp) 2>/dev/null && \
mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
-|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
-echo 'git directory not found: installing possibly empty changelog.' >&2)"
+|| (rm -f \$(top_srcdir)/.changelog.tmp; test -e \$(top_srcdir)/ChangeLog || ( \
+touch \$(top_srcdir)/ChangeLog; \
+echo 'git failed to create ChangeLog: installing empty ChangeLog.' >&2))"
@@ -10253,14 +10254,45 @@ echo 'git directory not found: installing possibly empty changelog.' >&2)"
macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
-|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
-echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
+|| (rm -f \$(top_srcdir)/.INSTALL.tmp; test -e \$(top_srcdir)/INSTALL || ( \
+touch \$(top_srcdir)/INSTALL; \
+echo 'failed to copy INSTALL from util-macros: installing empty INSTALL.' >&2))"
+case $host_os in
+ solaris*)
+ # Solaris 2.0 - 11.3 use SysV man page section numbers, so we
+ # check for a man page file found in later versions that use
+ # traditional section numbers instead
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/man/man7/attributes.7" >&5
+$as_echo_n "checking for /usr/share/man/man7/attributes.7... " >&6; }
+if ${ac_cv_file__usr_share_man_man7_attributes_7+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ test "$cross_compiling" = yes &&
+ as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
+if test -r "/usr/share/man/man7/attributes.7"; then
+ ac_cv_file__usr_share_man_man7_attributes_7=yes
+else
+ ac_cv_file__usr_share_man_man7_attributes_7=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_man_man7_attributes_7" >&5
+$as_echo "$ac_cv_file__usr_share_man_man7_attributes_7" >&6; }
+if test "x$ac_cv_file__usr_share_man_man7_attributes_7" = xyes; then :
+ SYSV_MAN_SECTIONS=false
+else
+ SYSV_MAN_SECTIONS=true
+fi
+
+ ;;
+ *) SYSV_MAN_SECTIONS=false ;;
+esac
+
if test x$APP_MAN_SUFFIX = x ; then
APP_MAN_SUFFIX=1
fi
@@ -10276,9 +10308,9 @@ if test x$LIB_MAN_DIR = x ; then
fi
if test x$FILE_MAN_SUFFIX = x ; then
- case $host_os in
- solaris*) FILE_MAN_SUFFIX=4 ;;
- *) FILE_MAN_SUFFIX=5 ;;
+ case $SYSV_MAN_SECTIONS in
+ true) FILE_MAN_SUFFIX=4 ;;
+ *) FILE_MAN_SUFFIX=5 ;;
esac
fi
if test x$FILE_MAN_DIR = x ; then
@@ -10286,9 +10318,9 @@ if test x$FILE_MAN_DIR = x ; then
fi
if test x$MISC_MAN_SUFFIX = x ; then
- case $host_os in
- solaris*) MISC_MAN_SUFFIX=5 ;;
- *) MISC_MAN_SUFFIX=7 ;;
+ case $SYSV_MAN_SECTIONS in
+ true) MISC_MAN_SUFFIX=5 ;;
+ *) MISC_MAN_SUFFIX=7 ;;
esac
fi
if test x$MISC_MAN_DIR = x ; then
@@ -10296,9 +10328,9 @@ if test x$MISC_MAN_DIR = x ; then
fi
if test x$DRIVER_MAN_SUFFIX = x ; then
- case $host_os in
- solaris*) DRIVER_MAN_SUFFIX=7 ;;
- *) DRIVER_MAN_SUFFIX=4 ;;
+ case $SYSV_MAN_SECTIONS in
+ true) DRIVER_MAN_SUFFIX=7 ;;
+ *) DRIVER_MAN_SUFFIX=4 ;;
esac
fi
if test x$DRIVER_MAN_DIR = x ; then
@@ -10306,9 +10338,9 @@ if test x$DRIVER_MAN_DIR = x ; then
fi
if test x$ADMIN_MAN_SUFFIX = x ; then
- case $host_os in
- solaris*) ADMIN_MAN_SUFFIX=1m ;;
- *) ADMIN_MAN_SUFFIX=8 ;;
+ case $SYSV_MAN_SECTIONS in
+ true) ADMIN_MAN_SUFFIX=1m ;;
+ *) ADMIN_MAN_SUFFIX=8 ;;
esac
fi
if test x$ADMIN_MAN_DIR = x ; then
@@ -11021,7 +11053,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by xkill $as_me 1.0.4, which was
+This file was extended by xkill $as_me 1.0.5, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -11087,7 +11119,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-xkill config.status 1.0.4
+xkill config.status 1.0.5
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/app/xkill/configure.ac b/app/xkill/configure.ac
index 96b88823a..ee95ecdbb 100644
--- a/app/xkill/configure.ac
+++ b/app/xkill/configure.ac
@@ -23,7 +23,7 @@ dnl Process this file with autoconf to create configure.
# Initialize Autoconf
AC_PREREQ([2.60])
-AC_INIT([xkill], [1.0.4],
+AC_INIT([xkill], [1.0.5],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [xkill])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS([config.h])
diff --git a/app/xkill/xkill.c b/app/xkill/xkill.c
index 2270dcdbd..2db584707 100644
--- a/app/xkill/xkill.c
+++ b/app/xkill/xkill.c
@@ -55,7 +55,7 @@ static char *ProgramName;
#define SelectButtonAny (-1)
#define SelectButtonFirst (-2)
-static int parse_button ( char *s, int *buttonp );
+static int parse_button ( const char *s, int *buttonp );
static XID get_window_id ( Display *dpy, int screen, int button, const char *msg );
static int catch_window_errors ( Display *dpy, XErrorEvent *ev );
static int kill_all_windows ( Display *dpy, int screenno, Bool top );
@@ -73,7 +73,7 @@ Exit(int code, Display *dpy)
}
static void _X_NORETURN
-usage(void)
+usage(const char *errmsg)
{
const char *options =
"where options include:\n"
@@ -85,6 +85,9 @@ usage(void)
" -version print version and exit\n"
"\n";
+ if (errmsg != NULL)
+ fprintf (stderr, "%s: %s\n\n", ProgramName, errmsg);
+
fprintf (stderr, "usage: %s [-option ...]\n%s",
ProgramName, options);
Exit (1, NULL);
@@ -112,11 +115,11 @@ main(int argc, char *argv[])
if (arg[0] == '-') {
switch (arg[1]) {
case 'd': /* -display displayname */
- if (++i >= argc) usage ();
+ if (++i >= argc) usage ("-display requires an argument");
displayname = argv[i];
continue;
case 'i': /* -id resourceid */
- if (++i >= argc) usage ();
+ if (++i >= argc) usage ("-id requires an argument");
id = strtoul (argv[i], NULL, 0);
if (id == 0 || id >= 0xFFFFFFFFU) {
fprintf (stderr, "%s: invalid id \"%s\"\n",
@@ -125,7 +128,7 @@ main(int argc, char *argv[])
}
continue;
case 'b': /* -button number */
- if (++i >= argc) usage ();
+ if (++i >= argc) usage ("-button requires an argument");
button_name = argv[i];
continue;
case 'f': /* -frame */
@@ -138,10 +141,14 @@ main(int argc, char *argv[])
puts(PACKAGE_STRING);
exit(0);
default:
- usage ();
+ fprintf(stderr, "%s: unrecognized argument %s\n\n",
+ ProgramName, arg);
+ usage (NULL);
}
} else {
- usage ();
+ fprintf(stderr, "%s: unrecognized argument %s\n\n",
+ ProgramName, arg);
+ usage (NULL);
}
} /* end for */
@@ -233,22 +240,11 @@ main(int argc, char *argv[])
}
static int
-parse_button(char *s, int *buttonp)
+parse_button(const char *s, int *buttonp)
{
- register char *cp;
-
- /* lower case name */
- for (cp = s; *cp; cp++) {
- if (isascii (*cp) && isupper (*cp)) {
-#ifdef _tolower
- *cp = (char) _tolower (*cp);
-#else
- *cp = (char) tolower (*cp);
-#endif /* _tolower */
- }
- }
+ const char *cp;
- if (strcmp (s, "any") == 0) {
+ if (strcasecmp (s, "any") == 0) {
*buttonp = SelectButtonAny;
return (1);
}