X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fdata-io%2Fget-data.c;h=cf96e415ade090795f11b6f40b52c3f3f3ee0225;hb=f5d1ac814687386b4cd6af9fa9e6f2f98913aa7d;hp=e746e9a05c35d9c2e5203b3633e57e19d64b4e1f;hpb=72c9c6a2f92e94779b2e55d0726568090411871c;p=pspp diff --git a/src/language/data-io/get-data.c b/src/language/data-io/get-data.c index e746e9a05c..cf96e415ad 100644 --- a/src/language/data-io/get-data.c +++ b/src/language/data-io/get-data.c @@ -566,16 +566,14 @@ parse_get_txt (struct lexer *lexer, struct dataset *ds) } int name_ofs = lex_ofs (lexer); - const char * tstr = lex_tokcstr (lexer); - if (tstr == NULL) - { - lex_error (lexer, NULL); - goto error; - } - name = xstrdup (tstr); - if (!lex_force_id (lexer) - || !dict_id_is_valid (dict, name, true)) - { + if (!lex_force_id (lexer)) + goto error; + name = xstrdup (lex_tokcstr (lexer)); + char *error = dict_id_is_valid__ (dict, name); + if (error) + { + lex_error (lexer, "%s", error); + free (error); goto error; } lex_get (lexer);