Merge remote-tracking branch 'origin/master' into sheet
[pspp] / src / language / lexer / variable-parser.c
index a45d384293ba9b6251433a60abd4d89480dbc9fa..d160b6f9791780a40b51000837a4c0fe3fadc2b4 100644 (file)
@@ -201,9 +201,9 @@ add_variable (struct variable ***v, size_t *nv, size_t *mv,
                "All variables in this variable list must have the "
                "same width.  %s will be omitted from the list."),
          var_get_name ((*v)[0]), add_name, add_name);
-  else if ((pv_opts & PV_NO_DUPLICATE) && included[idx])
+  else if ((pv_opts & PV_NO_DUPLICATE) && included && included[idx])
     msg (SE, _("Variable %s appears twice in variable list."), add_name);
-  else if ((pv_opts & PV_DUPLICATE) || !included[idx])
+  else if ((pv_opts & PV_DUPLICATE) || !included || !included[idx])
     {
       if (*nv >= *mv)
         {
@@ -635,7 +635,7 @@ parse_mixed_vars (struct lexer *lexer, const struct dictionary *dict,
     }
   if (*nnames == 0)
     goto fail;
-  
+
   return true;
 
 fail:
@@ -924,7 +924,7 @@ parse_internal_interaction (struct lexer *lexer, const struct dictionary *dict,
       *iact = NULL;
       return false;
     }
-  
+
   assert (v);
 
   if ( *iact == NULL)