Browse Source

The (..) is not mandatory now in select PTYPE. Fix issue #49

git-svn-id: https://klish.googlecode.com/svn/trunk@422 0eaa4687-2ee9-07dd-09d9-bcdd2d2dd5fb
Serj Kalichev 13 years ago
parent
commit
1d1358a5e3
2 changed files with 13 additions and 15 deletions
  1. 3 5
      clish/ptype/ptype.c
  2. 10 10
      configure

+ 3 - 5
clish/ptype/ptype.c

@@ -21,11 +21,10 @@ static char *clish_ptype_select__get_name(const clish_ptype_t * this,
 	char *result = NULL;
 	const char *arg = lub_argv__get_arg(this->u.select.items, index);
 	if (arg) {
-		size_t name_len = 0;
+		size_t name_len = strlen(arg);
 		const char *lbrk = strchr(arg, '(');
 		if (lbrk)
 			name_len = (size_t) (lbrk - arg);
-		assert(name_len < strlen(arg));	/* check for syntax error */
 		result = lub_string_dupn(arg, name_len);
 	}
 	return result;
@@ -40,14 +39,13 @@ static char *clish_ptype_select__get_value(const clish_ptype_t * this,
 	if (arg) {
 		const char *lbrk = strchr(arg, '(');
 		const char *rbrk = strchr(arg, ')');
-		const char *value = NULL;
-		size_t value_len = 0;
+		const char *value = arg;
+		size_t value_len = strlen(arg);
 		if (lbrk) {
 			value = lbrk + 1;
 			if (rbrk)
 				value_len = (size_t) (rbrk - value);
 		}
-		assert(value_len < strlen(arg));	/* check for syntax error */
 		result = lub_string_dupn(value, value_len);
 	}
 	return result;

+ 10 - 10
configure

@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for klish 1.4.2.
+# Generated by GNU Autoconf 2.68 for klish 1.5.0.
 #
 # Report bugs to <serj.kalichev at gmail dot com>.
 #
@@ -570,8 +570,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='klish'
 PACKAGE_TARNAME='klish'
-PACKAGE_VERSION='1.4.2'
-PACKAGE_STRING='klish 1.4.2'
+PACKAGE_VERSION='1.5.0'
+PACKAGE_STRING='klish 1.5.0'
 PACKAGE_BUGREPORT='serj.kalichev at gmail dot com'
 PACKAGE_URL=''
 
@@ -1327,7 +1327,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 klish 1.4.2 to adapt to many kinds of systems.
+\`configure' configures klish 1.5.0 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1397,7 +1397,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of klish 1.4.2:";;
+     short | recursive ) echo "Configuration of klish 1.5.0:";;
    esac
   cat <<\_ACEOF
 
@@ -1509,7 +1509,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-klish configure 1.4.2
+klish configure 1.5.0
 generated by GNU Autoconf 2.68
 
 Copyright (C) 2010 Free Software Foundation, Inc.
@@ -2177,7 +2177,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 klish $as_me 1.4.2, which was
+It was created by klish $as_me 1.5.0, which was
 generated by GNU Autoconf 2.68.  Invocation command line was
 
   $ $0 $@
@@ -15127,7 +15127,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='klish'
- VERSION='1.4.2'
+ VERSION='1.5.0'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -16800,7 +16800,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 klish $as_me 1.4.2, which was
+This file was extended by klish $as_me 1.5.0, which was
 generated by GNU Autoconf 2.68.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -16866,7 +16866,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="\\
-klish config.status 1.4.2
+klish config.status 1.5.0
 configured by $0, generated by GNU Autoconf 2.68,
   with options \\"\$ac_cs_config\\"