]> mj.ucw.cz Git - libucw.git/blobdiff - lib/shell/config.c
Merge with git+ssh://cvs.ucw.cz/projects/sherlock/GIT/sherlock.git
[libucw.git] / lib / shell / config.c
index 4a0910d1e725c9d4a95db55ba3ea66fdd80a701e..a4ac005a40300cbe54a627eb5da1ae808ee41590 100644 (file)
@@ -47,7 +47,7 @@ Usage: config [-C<configfile>] [-S<section>.<option>=<value>] <sections>\n\
 <value>\t\t[a-zA-Z0-9.-/]* | 'string without single quotes'<value> | \"c-like string\"<value>\n\
 \n\
 Types:\n\
 <value>\t\t[a-zA-Z0-9.-/]* | 'string without single quotes'<value> | \"c-like string\"<value>\n\
 \n\
 Types:\n\
-:\t\tString\n\
+<empty>\t\tString\n\
 #\t\t32-bit integer\n\
 ##\t\t64-bit integer\n\
 $\t\tFloating point number\n\
 #\t\t32-bit integer\n\
 ##\t\t64-bit integer\n\
 $\t\tFloating point number\n\
@@ -158,10 +158,10 @@ parse_section(struct section *section)
            }
          item->cf.cls = CC_STATIC;
          item->cf.number = 1;
            }
          item->cf.cls = CC_STATIC;
          item->cf.number = 1;
-         switch (*pos++)
+         switch (*pos)
            {
              case '#':
            {
              case '#':
-               if (*pos == '#')
+               if (*++pos == '#')
                  {
                    pos++;
                    item->cf.type = CT_U64;
                  {
                    pos++;
                    item->cf.type = CT_U64;
@@ -170,13 +170,14 @@ parse_section(struct section *section)
                  item->cf.type = CT_INT;
                break;
              case '$':
                  item->cf.type = CT_INT;
                break;
              case '$':
+               pos++;
                item->cf.type = CT_DOUBLE;
                break;
                item->cf.type = CT_DOUBLE;
                break;
-             case ':':
+             default:
+               if (!Cword(*pos))
+                 die("Invalid type syntax");
                item->cf.type = CT_STRING;
                break;
                item->cf.type = CT_STRING;
                break;
-             default:
-               die("Invalid type syntax");
            }
          parse_white();
          item->cf.name = parse_name();
            }
          parse_white();
          item->cf.name = parse_name();