]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - command_util.sh
command_util.sh: Make sure the "handler" pointer is NULL if a line handler exists.
[paraslash.git] / command_util.sh
index b757b2e0d29741097e649aeca38bd889b7541e70..ba5e99e2fcabb719ff0219f1ea65b2b4ded841a9 100755 (executable)
@@ -8,6 +8,7 @@ dump_array_member()
        if test $line_handler -eq 0; then
                echo ".handler = com_$name_txt,"
        else
+               echo ".handler = NULL,"
                echo ".line_handler = com_$name_txt,"
        fi
        if test -n "$perms_txt"; then
@@ -37,13 +38,11 @@ read_header()
                        ;;
                FN:)
                        file_name="$value"
+                       array_name=${value%command_list}cmds
                        ;;
                AT:)
                        array_type="$value"
                        ;;
-               AN:)
-                       array_name="$value"
-                       ;;
                IN:)
                        for i in $value; do
                                includes="$includes
@@ -178,7 +177,7 @@ com_man()
        done
 }
 
-com_array()
+com_c_file()
 {
        echo "/** \file $file_name.c $c_file_comment */"
        echo "$includes"
@@ -221,7 +220,7 @@ dump_proto()
        echo
 }
 
-com_proto()
+com_header()
 {
        echo "/** \file $file_name.h $header_comment */"
        echo
@@ -242,11 +241,11 @@ read_header
 arg="$1"
 shift
 case "$arg" in
-       "array")
-               com_array
+       "c")
+               com_c_file
                ;;
-       "proto")
-               com_proto
+       "h")
+               com_header
                ;;
        "man")
                com_man $*