X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Flexer%2Fvariable-parser.c;h=d160b6f9791780a40b51000837a4c0fe3fadc2b4;hb=6e097c89af440da90b43ce90864394c4d0c843d5;hp=8c4f8fe8a61acff13b83aee122c76ed2b4140e6c;hpb=23fd25fa0a2fb9d613f4f9445000e49cc3b83db1;p=pspp diff --git a/src/language/lexer/variable-parser.c b/src/language/lexer/variable-parser.c index 8c4f8fe8a6..d160b6f979 100644 --- a/src/language/lexer/variable-parser.c +++ b/src/language/lexer/variable-parser.c @@ -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) { @@ -633,7 +633,10 @@ parse_mixed_vars (struct lexer *lexer, const struct dictionary *dict, else if (!parse_DATA_LIST_vars (lexer, dict, names, nnames, PV_APPEND)) goto fail; } - return 1; + if (*nnames == 0) + goto fail; + + return true; fail: for (i = 0; i < *nnames; i++) @@ -641,7 +644,7 @@ fail: free (*names); *names = NULL; *nnames = 0; - return 0; + return false; } /* Parses a list of variables where some of the variables may be @@ -921,7 +924,7 @@ parse_internal_interaction (struct lexer *lexer, const struct dictionary *dict, *iact = NULL; return false; } - + assert (v); if ( *iact == NULL)