]> sourceware.org Git - lvm2.git/commitdiff
libdm-config: Interpret barewords after '=' as strings.
authorPetr Rockai <prockai@redhat.com>
Wed, 19 Nov 2014 17:48:47 +0000 (18:48 +0100)
committerPetr Rockai <prockai@redhat.com>
Thu, 20 Nov 2014 15:51:06 +0000 (16:51 +0100)
libdm/libdm-config.c

index e6b2b90d1ef26a2d339239a6716779abefe5cbad..1bc88e15c9105051a9c064ff249f8adcc14d8153 100644 (file)
@@ -30,6 +30,7 @@ enum {
        TOK_FLOAT,
        TOK_STRING,             /* Single quotes */
        TOK_STRING_ESCAPED,     /* Double quotes */
+       TOK_STRING_BARE,        /* No quotes */
        TOK_EQ,
        TOK_SECTION_B,
        TOK_SECTION_E,
@@ -638,6 +639,15 @@ static struct dm_config_value *_type(struct parser *p)
                match(TOK_STRING);
                break;
 
+       case TOK_STRING_BARE:
+               v->type = DM_CFG_STRING;
+
+               if (!(v->v.str = _dup_tok(p)))
+                       return_NULL;
+
+               match(TOK_STRING_BARE);
+               break;
+
        case TOK_STRING_ESCAPED:
                v->type = DM_CFG_STRING;
 
@@ -783,6 +793,8 @@ static void _get_token(struct parser *p, int tok_prev)
                       (*te != SECTION_B_CHAR) &&
                       (*te != SECTION_E_CHAR))
                        te++;
+               if (values_allowed)
+                       p->t = TOK_STRING_BARE;
                break;
        }
 
This page took 0.039889 seconds and 5 git commands to generate.