stdint.h-instead-of-size_max.h.patch from patch #6230.
[pspp-builds.git] / src / language / data-io / data-list.c
index 9f77ed8d9a135b7751ba408662779e70d1b7b70a..6ca829fc5ab7d75d5459c58d1d828436cc5d5c3c 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <ctype.h>
 #include <float.h>
+#include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
 
@@ -39,7 +40,6 @@
 #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>
@@ -49,8 +49,8 @@
 #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)
@@ -249,6 +249,12 @@ cmd_data_list (struct lexer *lexer, struct dataset *ds)
   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;
 
@@ -807,10 +813,10 @@ data_list_trns_proc (void *dls_, struct ccase *c, casenumber case_num UNUSED)
   if (dls->end != NULL)
     {
       double *end = &case_data_rw (c, dls->end)->f;
-      if (retval == TRNS_DROP_CASE)
+      if (retval == TRNS_END_FILE)
         {
           *end = 1.0;
-          retval = TRNS_END_FILE;
+          retval = TRNS_CONTINUE;
         }
       else
         *end = 0.0;