projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed error running 'make distcheck'
[pspp]
/
src
/
language
/
data-io
/
get.c
diff --git
a/src/language/data-io/get.c
b/src/language/data-io/get.c
index 1218a27b18bdfc147ca690581cec4bacdb015811..00e78c8f00c1a39922ae3179200b6f8fb8591a9c 100644
(file)
--- a/
src/language/data-io/get.c
+++ b/
src/language/data-io/get.c
@@
-1,5
+1,5
@@
/* PSPP - a program for statistical analysis.
/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000, 2006
, 2007, 2010, 2011, 2012, 2013
Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 2006
-2007, 2010-15
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
@@
-31,6
+31,7
@@
#include "language/lexer/lexer.h"
#include "libpspp/compiler.h"
#include "libpspp/misc.h"
#include "language/lexer/lexer.h"
#include "libpspp/compiler.h"
#include "libpspp/misc.h"
+#include "libpspp/message.h"
#include "libpspp/str.h"
#include "gl/xalloc.h"
#include "libpspp/str.h"
#include "gl/xalloc.h"
@@
-108,7
+109,7
@@
parse_read_command (struct lexer *lexer, struct dataset *ds,
if (!lex_match_id (lexer, "COMM")
&& !lex_match_id (lexer, "TAPE"))
{
if (!lex_match_id (lexer, "COMM")
&& !lex_match_id (lexer, "TAPE"))
{
- lex_error_expecting (lexer, "COMM", "TAPE"
, NULL_SENTINEL
);
+ lex_error_expecting (lexer, "COMM", "TAPE");
goto error;
}
}
goto error;
}
}
@@
-122,16
+123,23
@@
parse_read_command (struct lexer *lexer, struct dataset *ds,
goto error;
}
goto error;
}
- reader = any_reader_open
(fh, encoding, &dict
);
+ reader = any_reader_open
_and_decode (fh, encoding, &dict, NULL
);
if (reader == NULL)
goto error;
if (reader == NULL)
goto error;
+ if (dict_get_var_cnt (dict) == 0)
+ {
+ msg (SE, _("%s: Data file dictionary has no variables."),
+ fh_get_name (fh));
+ goto error;
+ }
+
stage = case_map_stage_create (dict);
while (lex_token (lexer) != T_ENDCMD)
{
lex_match (lexer, T_SLASH);
stage = case_map_stage_create (dict);
while (lex_token (lexer) != T_ENDCMD)
{
lex_match (lexer, T_SLASH);
- if (!parse_dict_trim (lexer, dict))
+ if (!parse_dict_trim (lexer, dict
, false
))
goto error;
}
dict_compact_values (dict);
goto error;
}
dict_compact_values (dict);
@@
-153,7
+161,7
@@
parse_read_command (struct lexer *lexer, struct dataset *ds,
fh_unref (fh);
casereader_destroy (reader);
if (dict != NULL)
fh_unref (fh);
casereader_destroy (reader);
if (dict != NULL)
- dict_
destroy
(dict);
+ dict_
unref
(dict);
free (encoding);
return CMD_CASCADING_FAILURE;
}
free (encoding);
return CMD_CASCADING_FAILURE;
}