First step in making struct variable opaque: the boring mechanical
[pspp-builds.git] / src / language / dictionary / value-labels.c
index 12948e28ee0328a33d50cb2d7016245374390834..5ac8fb52a2ca4e11dd0b436a2c71e301e7864a80 100644 (file)
@@ -118,10 +118,10 @@ verify_val_labs (struct variable **vars, size_t var_cnt)
     {
       struct variable *vp = vars[i];
 
-      if (vp->type == ALPHA && vp->width > MAX_SHORT_STRING)
+      if (var_is_long_string (vp))
        {
          msg (SE, _("It is not possible to assign value labels to long "
-                    "string variables such as %s."), vp->name);
+                    "string variables such as %s."), var_get_name (vp));
          return 0;
        }
     }
@@ -152,7 +152,7 @@ get_label (struct lexer *lexer, struct variable **vars, size_t var_cnt)
       size_t i;
 
       /* Set value. */
-      if (vars[0]->type == ALPHA)
+      if (var_is_alpha (vars[0]))
        {
          if (lex_token (lexer) != T_STRING)
            {
@@ -173,6 +173,7 @@ get_label (struct lexer *lexer, struct variable **vars, size_t var_cnt)
          value.f = lex_tokval (lexer);
        }
       lex_get (lexer);
+      lex_match (lexer, ',');
 
       /* Set label. */
       if (!lex_force_string (lexer))
@@ -192,6 +193,7 @@ get_label (struct lexer *lexer, struct variable **vars, size_t var_cnt)
       ds_destroy (&label);
 
       lex_get (lexer);
+      lex_match (lexer, ',');
     }
   while (lex_token (lexer) != '/' && lex_token (lexer) != '.');