summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6543bbf)
raw | patch | inline | side by side (parent: 6543bbf)
author | Kalle Wallin <kaw@linux.se> | |
Mon, 12 Jul 2004 09:22:16 +0000 (09:22 +0000) | ||
committer | Kalle Wallin <kaw@linux.se> | |
Mon, 12 Jul 2004 09:22:16 +0000 (09:22 +0000) |
ChangeLog | patch | blob | history | |
configure.ac | patch | blob | history | |
src/options.c | patch | blob | history |
diff --git a/ChangeLog b/ChangeLog
index d7d33aa235e15a993ea5699b27812d314b935b1e..9e56ec81cc082819390d27e212092d9062b2a705 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
+2004-07-12 Kalle Wallin <kaw@linux.se>
+ * options.c: fixed short option handling for multiple short options
+ at once (-abcde)
+
2004-07-09 Kalle Wallin <kaw@linux.se>
- * ncmpc-0.11.0 released
+ * ncmpc-0.11.0 released (r1820)
2004-07-08 Kalle Wallin <kaw@linux.se>
* doc/keys.sample: Welcome back
diff --git a/configure.ac b/configure.ac
index c58a6cc4fc7efc1b60fcd5cdbd13aa8d7362826c..e2e0a232e2fa73b773c4f83c14d798eea2690ee5 100644 (file)
--- a/configure.ac
+++ b/configure.ac
AC_INIT
AC_CONFIG_SRCDIR([src/main.c])
-AM_INIT_AUTOMAKE(ncmpc, 0.11.0)
+AM_INIT_AUTOMAKE([ncmpc], [0.11.1-svn])
AM_CONFIG_HEADER([config.h])
dnl Check for programs
dnl Check for glib-2.4
PKG_CHECK_MODULES([GLIB],
[glib-2.0 >= 2.4],
- glib24=yes,
- AC_MSG_WARN([glib-2.4 is required for NLS support!]))
+ [glib24=yes],
+ [AC_MSG_WARN([glib-2.4 is required for NLS support!])])
if test "x$glib24" != "xyes"; then
PKG_CHECK_MODULES([GLIB],
[glib-2.0 >= 2.2],
- nls=no,
- AC_MSG_ERROR([glib-2.2 is required]))
+ [nls=no],
+ [AC_MSG_ERROR([glib-2.2 is required])])
fi
diff --git a/src/options.c b/src/options.c
index 314a0e98cc71c3a8948b551381c2b1c7daa0fa9b..94da5b8369dee552f5e7ea8559995e68c7ee642b 100644 (file)
--- a/src/options.c
+++ b/src/options.c
fprintf(stderr, PACKAGE ": invalid option %s=%s\n", option, arg);
break;
case ERROR_MISSING_ARGUMENT:
- fprintf(stderr, PACKAGE ": missing value for %s\n", option);
+ fprintf(stderr, PACKAGE ": missing value for %s option\n", option);
break;
default:
fprintf(stderr, PACKAGE ": internal error %d\n", error);
opt = NULL;
}
}
- /* check for a short option */
- else if( len==2 && g_str_has_prefix(arg, "-") )
+ /* check for short options */
+ else if( len>=2 && g_str_has_prefix(arg, "-") )
{
- /* make shure we got an argument for the previous option */
- if( opt && opt->argument )
- option_error(ERROR_MISSING_ARGUMENT, opt->longopt, opt->argument);
+ int j;
- /* check if the option exists */
- if( (opt=lookup_option(arg[1], NULL))==NULL )
- option_error(ERROR_UNKNOWN_OPTION, arg, NULL);
-
- /* if no option argument is needed execute callback */
- if( opt->argument==NULL )
+ for(j=1; j<len; j++)
{
- option_cb (opt->shortopt, NULL);
- opt = NULL;
+ /* make shure we got an argument for the previous option */
+ if( opt && opt->argument )
+ option_error(ERROR_MISSING_ARGUMENT,
+ opt->longopt, opt->argument);
+
+ /* check if the option exists */
+ if( (opt=lookup_option(arg[j], NULL))==NULL )
+ option_error(ERROR_UNKNOWN_OPTION, arg, NULL);
+
+ /* if no option argument is needed execute callback */
+ if( opt->argument==NULL )
+ {
+ option_cb (opt->shortopt, NULL);
+ opt = NULL;
+ }
}
}
else