/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000, 2006, 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 2006, 2010, 2011, 2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include <config.h>
-#include "language/lexer/format-parser.h"
-
#include <ctype.h>
#include <stdint.h>
#include <stdlib.h>
struct substring type_ss, width_ss, decimals_ss;
bool has_decimals;
- if (lex_token (lexer) != T_ID)
+ if (lex_token (lexer) != T_ID && lex_token (lexer) != T_STRING)
goto error;
/* Extract pieces. */
return false;
}
+ if (format->w == 0 && !strchr (lex_tokcstr (lexer), '0'))
+ {
+ msg (SE, _("Format specifier `%s' lacks required width."),
+ lex_tokcstr (lexer));
+ return false;
+ }
+
lex_get (lexer);
return true;
}