projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge 'master' into 'psppsheet'.
[pspp]
/
src
/
data
/
data-in.c
diff --git
a/src/data/data-in.c
b/src/data/data-in.c
index b6fa5167f008a8aaa471b3d3fe9762fed7301fb5..5d4496cf9085de0d54509f224a89e0b0261935d1 100644
(file)
--- a/
src/data/data-in.c
+++ b/
src/data/data-in.c
@@
-1,5
+1,5
@@
/* PSPP - a program for statistical analysis.
/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000, 2006, 2009, 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 2006, 2009, 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
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
@@
-281,7
+281,6
@@
parse_number (struct data_in *i)
struct string tmp;
struct string tmp;
- bool explicit_decimals = false;
int save_errno;
char *tail;
int save_errno;
char *tail;
@@
-298,9
+297,9
@@
parse_number (struct data_in *i)
ds_extend (&tmp, 64);
/* Prefix character may precede sign. */
ds_extend (&tmp, 64);
/* Prefix character may precede sign. */
- if (
!ss_is_empty (style->prefix)
)
+ if (
style->prefix.s[0] != '\0'
)
{
{
- ss_match_byte (&i->input, s
s_first (style->prefix)
);
+ ss_match_byte (&i->input, s
tyle->prefix.s[0]
);
ss_ltrim (&i->input, ss_cstr (CC_SPACES));
}
ss_ltrim (&i->input, ss_cstr (CC_SPACES));
}
@@
-317,9
+316,9
@@
parse_number (struct data_in *i)
}
/* Prefix character may follow sign. */
}
/* Prefix character may follow sign. */
- if (
!ss_is_empty (style->prefix)
)
+ if (
style->prefix.s[0] != '\0'
)
{
{
- ss_match_byte (&i->input, s
s_first (style->prefix)
);
+ ss_match_byte (&i->input, s
tyle->prefix.s[0]
);
ss_ltrim (&i->input, ss_cstr (CC_SPACES));
}
ss_ltrim (&i->input, ss_cstr (CC_SPACES));
}
@@
-334,7
+333,6
@@
parse_number (struct data_in *i)
/* Decimal point and following digits. */
if (ss_match_byte (&i->input, style->decimal))
{
/* Decimal point and following digits. */
if (ss_match_byte (&i->input, style->decimal))
{
- explicit_decimals = true;
ds_put_byte (&tmp, '.');
while (c_isdigit (ss_first (i->input)))
ds_put_byte (&tmp, ss_get_byte (&i->input));
ds_put_byte (&tmp, '.');
while (c_isdigit (ss_first (i->input)))
ds_put_byte (&tmp, ss_get_byte (&i->input));
@@
-345,7
+343,6
@@
parse_number (struct data_in *i)
&& !ss_is_empty (i->input)
&& strchr ("eEdD-+", ss_first (i->input)))
{
&& !ss_is_empty (i->input)
&& strchr ("eEdD-+", ss_first (i->input)))
{
- explicit_decimals = true;
ds_put_byte (&tmp, 'e');
if (strchr ("eEdD", ss_first (i->input)))
ds_put_byte (&tmp, 'e');
if (strchr ("eEdD", ss_first (i->input)))
@@
-366,8
+363,8
@@
parse_number (struct data_in *i)
}
/* Suffix character. */
}
/* Suffix character. */
- if (
!ss_is_empty (style->suffix)
)
- ss_match_byte (&i->input, s
s_first (style->suffix)
);
+ if (
style->suffix.s[0] != '\0'
)
+ ss_match_byte (&i->input, s
tyle->suffix.s[0]
);
if (!ss_is_empty (i->input))
{
if (!ss_is_empty (i->input))
{
@@
-1123,7
+1120,7
@@
parse_date (struct data_in *i)
double time = 0, date = 0;
enum time_sign time_sign = SIGN_NO_TIME;
double time = 0, date = 0;
enum time_sign time_sign = SIGN_NO_TIME;
- const char *template = fmt_date_template (i->format);
+ const char *template = fmt_date_template (i->format
, 0
);
size_t template_width = strlen (template);
char *error;
size_t template_width = strlen (template);
char *error;
@@
-1180,14
+1177,18
@@
parse_date (struct data_in *i)
case '-':
case '/':
case '.':
case '-':
case '/':
case '.':
- case 'X':
error = parse_date_delimiter (i);
break;
case ':':
error = parse_time_delimiter (i);
case ' ':
error = parse_date_delimiter (i);
break;
case ':':
error = parse_time_delimiter (i);
case ' ':
- parse_spaces (i);
- error = NULL;
+ if (i->format != FMT_MOYR)
+ {
+ parse_spaces (i);
+ error = NULL;
+ }
+ else
+ error = parse_date_delimiter (i);
break;
default:
assert (count == 1);
break;
default:
assert (count == 1);