#include <ctype.h>
#include <float.h>
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <language/lexer/format-parser.h>
#include <language/lexer/lexer.h>
#include <language/lexer/variable-parser.h>
-#include <libpspp/alloc.h>
#include <libpspp/assertion.h>
#include <libpspp/compiler.h>
#include <libpspp/ll.h>
#include <libpspp/str.h>
#include <output/table.h>
-#include "size_max.h"
#include "xsize.h"
+#include "xalloc.h"
#include "gettext.h"
#define _(msgid) gettext (msgid)
struct dictionary *dict;
struct data_list_pgm *dls;
int table = -1; /* Print table if nonzero, -1=undecided. */
- struct file_handle *fh = fh_inline_file ();
+ struct file_handle *fh = NULL;
struct pool *tmp_pool;
bool ok;
if (lex_match_id (lexer, "FILE"))
{
lex_match (lexer, '=');
+ fh_unref (fh);
fh = fh_parse (lexer, FH_REF_FILE | FH_REF_INLINE);
if (fh == NULL)
goto error;
}
}
+ if (fh == NULL)
+ fh = fh_inline_file ();
fh_set_default_handle (fh);
if (dls->type == -1)
dls->type = DLS_FIXED;
+ if (dls->type != DLS_FIXED && dls->end != NULL)
+ {
+ msg (SE, _("The END keyword may be used only with DATA LIST FIXED."));
+ goto error;
+ }
+
if (table == -1)
table = dls->type != DLS_FREE;
}
pool_destroy (tmp_pool);
+ fh_unref (fh);
return CMD_SUCCESS;
error:
+ fh_unref (fh);
data_list_trns_free (dls);
return CMD_CASCADING_FAILURE;
}