From: Ben Pfaff Date: Tue, 3 May 2005 06:46:03 +0000 (+0000) Subject: Partial fix for PR 12859. X-Git-Tag: v0.4.0~96 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=05a2c3f6e9560a57e87206ac3358946bf6d43b42;p=pspp-builds.git Partial fix for PR 12859. --- diff --git a/src/ChangeLog b/src/ChangeLog index 66c76f13..f5c79c77 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,19 @@ +Mon May 2 23:45:01 2005 Ben Pfaff + + Code improvements. + + * data-list.c: (parse_fixed) Use lex_end_of_command(). + (parse_free) Ditto. + (cmd_repeating_data) Set cont_end.num in right situations. + (parse_repeating_data) Remove redundant test. + +Mon May 2 23:37:19 2005 Ben Pfaff + + Partial fix for PR 12859. + + * data-list.c: (cmd_data_list) Add transformation properly in + vfm_source == NULL case. + Mon May 2 23:27:28 2005 Ben Pfaff * lexer.c: (lex_error) Improve error messages. diff --git a/src/data-list.c b/src/data-list.c index 3d730939..1e9deb80 100644 --- a/src/data-list.c +++ b/src/data-list.c @@ -268,14 +268,9 @@ cmd_data_list (void) if (vfm_source != NULL) { - struct data_list_pgm *new_pgm; - dls->h.proc = data_list_trns_proc; dls->h.free = data_list_trns_free; - - new_pgm = xmalloc (sizeof *new_pgm); - memcpy (new_pgm, &dls, sizeof *new_pgm); - add_transformation (&new_pgm->h); + add_transformation (&dls->h); } else vfm_source = create_case_source (&data_list_source_class, dls); @@ -404,12 +399,7 @@ parse_fixed (struct data_list_pgm *dls) } else if (!dls->rec_cnt) dls->rec_cnt = dls->last->rec; - if (token != '.') - { - lex_error (_("expecting end of command")); - return 0; - } - return 1; + return lex_end_of_command () == CMD_SUCCESS; fail: for (i = 0; i < fx.name_cnt; i++) @@ -897,9 +887,7 @@ parse_free (struct dls_var_spec **first, struct dls_var_spec **last) free (name); } - if (token != '.') - lex_error (_("expecting end of command")); - return 1; + return lex_end_of_command () == CMD_SUCCESS; } /* Displays a table giving information on free-format variable parsing @@ -1602,7 +1590,7 @@ cmd_repeating_data (void) /* Calculate starts_end, cont_end if necessary. */ if (rpd->starts_end.num == 0 && rpd->starts_end.var == NULL) rpd->starts_end.num = handle_get_record_width (fh); - if (rpd->cont_end.num == 0 && rpd->starts_end.var == NULL) + if (rpd->cont_end.num == 0 && rpd->cont_end.var == NULL) rpd->cont_end.num = handle_get_record_width (fh); /* Calculate length if possible. */ @@ -1739,7 +1727,7 @@ parse_repeating_data (struct dls_var_spec **first, struct dls_var_spec **last) else { msg (SE, _("SPSS-like or FORTRAN-like format " - "specification expected after variable names.")); + "specification expected after variable names.")); goto fail; } @@ -1747,11 +1735,6 @@ parse_repeating_data (struct dls_var_spec **first, struct dls_var_spec **last) free (fx.name[i]); free (fx.name); } - if (token != '.') - { - lex_error (_("expecting end of command")); - return 0; - } return 1;