X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fvars-prs.c;h=21340ef031d1dddcb2503355b41b5bb475473acc;hb=97d6c6f6b1922621ca013668eba9a9a9f71d60fe;hp=8b15fd7bc91a8a1f44156788554028452ee58320;hpb=37597beca4a11edba50b847932fdfeca3a648fa2;p=pspp diff --git a/src/vars-prs.c b/src/vars-prs.c index 8b15fd7bc9..21340ef031 100644 --- a/src/vars-prs.c +++ b/src/vars-prs.c @@ -19,7 +19,6 @@ #include #include "var.h" -#include #include #include #include "alloc.h" @@ -105,12 +104,14 @@ dict_class_to_name (enum dict_class dict_class) return _("scratch"); default: assert (0); + abort (); } } /* Parses a set of variables from dictionary D given options OPTS. Resulting list of variables stored in *VAR and the - number of variables into *CNT. */ + number of variables into *CNT. Returns nonzero only if + successful. */ int parse_variables (struct dictionary *d, struct variable ***var, int *cnt, int opts) @@ -392,7 +393,8 @@ parse_DATA_LIST_vars (char ***names, int *nnames, int pv_opts) lex_error ("expecting variable name"); goto fail; } - if (tokid[0] == '#' && (pv_opts & PV_NO_SCRATCH)) + if (dict_class_from_id (tokid) == DC_SCRATCH + && (pv_opts & PV_NO_SCRATCH)) { msg (SE, _("Scratch variables not allowed here.")); goto fail;