X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fxforms%2Frecode.c;h=e2074823f9df4185aa9db4bcd29a6c6615e25bd3;hb=31e674bbb5a058689708edebe6a06045015d223f;hp=eef48f3d09a0822680fc9cb49d5ec700518dce8a;hpb=d6f31aec49cf2d0913ed4e88b0d821b296e9e167;p=pspp-builds.git diff --git a/src/language/xforms/recode.c b/src/language/xforms/recode.c index eef48f3d..e2074823 100644 --- a/src/language/xforms/recode.c +++ b/src/language/xforms/recode.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 1997-9, 2000 Free Software Foundation, Inc. + Copyright (C) 1997-9, 2000, 2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -397,8 +397,11 @@ parse_map_out (struct lexer *lexer, struct pool *pool, struct map_out *out) set_map_out_str (out, pool, lex_tokstr (lexer)); lex_get (lexer); } - else if (lex_match_id (lexer, "COPY")) - out->copy_input = true; + else if (lex_match_id (lexer, "COPY")) + { + out->copy_input = true; + out->width = 0; + } else { lex_error (lexer, _("expecting output value")); @@ -644,18 +647,19 @@ find_src_string (struct recode_trns *trns, const char *value, const struct varia /* Performs RECODE transformation. */ static int -recode_trns_proc (void *trns_, struct ccase *c, casenumber case_idx UNUSED) +recode_trns_proc (void *trns_, struct ccase **c, casenumber case_idx UNUSED) { struct recode_trns *trns = trns_; size_t i; + *c = case_unshare (*c); for (i = 0; i < trns->var_cnt; i++) { const struct variable *src_var = trns->src_vars[i]; const struct variable *dst_var = trns->dst_vars[i]; - const union value *src_data = case_data (c, src_var); - union value *dst_data = case_data_rw (c, dst_var); + const union value *src_data = case_data (*c, src_var); + union value *dst_data = case_data_rw (*c, dst_var); const struct map_out *out;