X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fweight.c;h=c95b7910b28ff5d81365074ea0f800d2a6746354;hb=ae692b0ac5ceff417fa9e9fc136d95acae3e99e1;hp=fd19f8c8978a371ea6f3003dc4a92a6f2eca32f1;hpb=37597beca4a11edba50b847932fdfeca3a648fa2;p=pspp diff --git a/src/weight.c b/src/weight.c index fd19f8c897..c95b7910b2 100644 --- a/src/weight.c +++ b/src/weight.c @@ -18,9 +18,10 @@ 02111-1307, USA. */ #include -#include +#include "error.h" #include #include "command.h" +#include "dictionary.h" #include "error.h" #include "lexer.h" #include "str.h" @@ -37,8 +38,6 @@ struct weight_trns int cmd_weight (void) { - lex_match_id ("WEIGHT"); - if (lex_match_id ("OFF")) dict_set_weight (default_dict, NULL); else @@ -54,7 +53,7 @@ cmd_weight (void) msg (SE, _("The weighting variable must be numeric.")); return CMD_FAILURE; } - if (v->name[0] == '#') + if (dict_class_from_id (v->name) == DC_SCRATCH) { msg (SE, _("The weighting variable may not be scratch.")); return CMD_FAILURE;