projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
src/libpspp/zip-reader.c: Possible fix for windoze ODS reading issues.
[pspp]
/
src
/
data
/
por-file-reader.c
diff --git
a/src/data/por-file-reader.c
b/src/data/por-file-reader.c
index 372d7682136f746110e4cc05d19c04ac30265824..a4d13ec7bc4b927c88cac19a3d9920db08da7ece 100644
(file)
--- a/
src/data/por-file-reader.c
+++ b/
src/data/por-file-reader.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, 2013
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
@@
-38,6
+38,7
@@
#include "data/value-labels.h"
#include "data/variable.h"
#include "libpspp/compiler.h"
#include "data/value-labels.h"
#include "data/variable.h"
#include "libpspp/compiler.h"
+#include "libpspp/i18n.h"
#include "libpspp/message.h"
#include "libpspp/misc.h"
#include "libpspp/pool.h"
#include "libpspp/message.h"
#include "libpspp/misc.h"
#include "libpspp/pool.h"
@@
-250,7
+251,7
@@
pfm_open_reader (struct file_handle *fh, struct dictionary **dict,
struct pool *volatile pool = NULL;
struct pfm_reader *volatile r = NULL;
struct pool *volatile pool = NULL;
struct pfm_reader *volatile r = NULL;
- *dict = dict_create ();
+ *dict = dict_create (
get_default_encoding ()
);
/* Create and initialize reader. */
pool = pool_create ();
/* Create and initialize reader. */
pool = pool_create ();
@@
-539,7
+540,7
@@
read_version_data (struct pfm_reader *r, struct pfm_read_info *info)
{
static const char empty_string[] = "";
char *date, *time;
{
static const char empty_string[] = "";
char *date, *time;
- const char *product, *
author, *
subproduct;
+ const char *product, *subproduct;
int i;
/* Read file. */
int i;
/* Read file. */
@@
-548,7
+549,11
@@
read_version_data (struct pfm_reader *r, struct pfm_read_info *info)
date = read_pool_string (r);
time = read_pool_string (r);
product = match (r, '1') ? read_pool_string (r) : empty_string;
date = read_pool_string (r);
time = read_pool_string (r);
product = match (r, '1') ? read_pool_string (r) : empty_string;
- author = match (r, '2') ? read_pool_string (r) : empty_string;
+ if (match (r, '2'))
+ {
+ /* Skip "author" field. */
+ read_pool_string (r);
+ }
subproduct = match (r, '3') ? read_pool_string (r) : empty_string;
/* Validate file. */
subproduct = match (r, '3') ? read_pool_string (r) : empty_string;
/* Validate file. */
@@
-652,8
+657,8
@@
read_variables (struct pfm_reader *r, struct dictionary *dict)
if (r->var_cnt <= 0)
error (r, _("Invalid number of variables %d."), r->var_cnt);
if (r->var_cnt <= 0)
error (r, _("Invalid number of variables %d."), r->var_cnt);
- /* Purpose of this value is unknown. It is typically 161. */
- read_int (r);
+ if (match (r, '5'))
+
read_int (r);
if (match (r, '6'))
{
if (match (r, '6'))
{
@@
-745,7
+750,7
@@
read_variables (struct pfm_reader *r, struct dictionary *dict)
{
char label[256];
read_string (r, label);
{
char label[256];
read_string (r, label);
- var_set_label (v, label,
NULL,
false); /* XXX */
+ var_set_label (v, label, false); /* XXX */
}
}
}
}