projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update to latest Gnulib
[pspp]
/
src
/
language
/
expressions
/
operations.def
diff --git
a/src/language/expressions/operations.def
b/src/language/expressions/operations.def
index b7783257cdd990548541ee68b60c638bcf0476e7..0286acf91e393d917a1259181165d4c8c88c8934 100644
(file)
--- a/
src/language/expressions/operations.def
+++ b/
src/language/expressions/operations.def
@@
-581,8
+581,19
@@
string function RTRIM (string s, string c)
function NUMBER (string s, ni_format f)
{
union value out;
function NUMBER (string s, ni_format f)
{
union value out;
- data_in (ss_head (s, f->w), LEGACY_NATIVE, f->type, 0, 0, &out, 0, NULL);
+ char *error;
+
+ if (s.length > f->w)
+ s.length = f->w;
+ error = data_in (s, LEGACY_NATIVE, f->type, &out, 0, NULL);
+ if (error == NULL)
data_in_imply_decimals (s, LEGACY_NATIVE, f->type, f->d, &out);
data_in_imply_decimals (s, LEGACY_NATIVE, f->type, f->d, &out);
+ else
+ {
+ msg (SE, "Cannot parse \"%.*s\" as format %s: %s",
+ (int) s.length, s.string, fmt_name (f->type), error);
+ free (error);
+ }
return out.f;
}
return out.f;
}