(cmd_data_list): Don't allow END subcommand to be used with DATA LIST
[pspp-builds.git] / src / language / data-io / data-list.c
index 9f77ed8d9a135b7751ba408662779e70d1b7b70a..75db52af6548f61baa214f9250856778565fb53b 100644 (file)
@@ -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;