Improve error messages for format specifiers.
[pspp] / src / language / data-io / data-list.c
index 546e33f21e86424278256c4709ec7ef779597250..af24b373cbab61b8202eaf8302c83f7d5e4f1ef3 100644 (file)
@@ -464,7 +464,14 @@ parse_free (struct lexer *lexer, struct dictionary *dict,
               input.d = 0;
             }
 
-          if (!fmt_check_input (&input) || !lex_force_match (lexer, T_RPAREN))
+          char *error = fmt_check_input__ (&input);
+          if (error)
+            {
+              lex_next_error (lexer, -1, -1, "%s", error);
+              free (error);
+              return NULL;
+            }
+          if (!lex_force_match (lexer, T_RPAREN))
             return NULL;
 
           /* As a special case, N format is treated as F format