projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Handle case of a lookup table as the active file.
[pspp]
/
src
/
recode.c
diff --git
a/src/recode.c
b/src/recode.c
index 98e6dfdd2d0ecf1cddf842db228129439363b95f..90792afa4197d5a204423b312847e3c2d4d51127 100644
(file)
--- a/
src/recode.c
+++ b/
src/recode.c
@@
-378,7
+378,7
@@
cmd_recode (void)
/* The NULL is only really necessary for the
debugging code. */
char *repl = xmalloc (max_dst_width + 1);
/* The NULL is only really necessary for the
debugging code. */
char *repl = xmalloc (max_dst_width + 1);
- st
_pad_copy (repl, cp->t.c, max_dst_width + 1
);
+ st
r_copy_rpad (repl, max_dst_width + 1, cp->t.c
);
free (cp->t.c);
cp->t.c = repl;
}
free (cp->t.c);
cp->t.c = repl;
}
@@
-412,7
+412,7
@@
cmd_recode (void)
rcd->dest = dict_create_var (default_dict, rcd->dest_name, 0);
if (!rcd->dest)
{
rcd->dest = dict_create_var (default_dict, rcd->dest_name, 0);
if (!rcd->dest)
{
- /* FIXME: This can
occur
if a destname is duplicated.
+ /* FIXME: This can
fail
if a destname is duplicated.
We could give an error at parse time but I don't
care enough. */
rcd->dest = dict_lookup_var_assert (default_dict, rcd->dest_name);
We could give an error at parse time but I don't
care enough. */
rcd->dest = dict_lookup_var_assert (default_dict, rcd->dest_name);
@@
-463,7
+463,7
@@
parse_dest_spec (struct rcd_var * rcd, union value * v, size_t *max_dst_width)
if (toklen > max)
max = toklen;
v->c = xmalloc (max + 1);
if (toklen > max)
max = toklen;
v->c = xmalloc (max + 1);
- st
_pad_copy (v->c, ds_c_str (&tokstr), max + 1
);
+ st
r_copy_rpad (v->c, max + 1, ds_c_str (&tokstr)
);
flags = RCD_DEST_STRING;
*max_dst_width = max;
lex_get ();
flags = RCD_DEST_STRING;
*max_dst_width = max;
lex_get ();
@@
-626,7
+626,7
@@
parse_src_spec (struct rcd_var * rcd, int type, size_t max_src_width)
if (!lex_force_string ())
return 0;
c->f1.c = xmalloc (max_src_width + 1);
if (!lex_force_string ())
return 0;
c->f1.c = xmalloc (max_src_width + 1);
- st
_pad_copy (c->f1.c, ds_c_str (&tokstr), max_src_width + 1
);
+ st
r_copy_rpad (c->f1.c, max_src_width + 1, ds_c_str (&tokstr)
);
lex_get ();
}
}
lex_get ();
}
}
@@
-811,9
+811,9
@@
recode_trns_proc (struct trns_header * t, struct ccase * c,
if (val == NULL)
{
if (v->dest->fv != v->src->fv)
if (val == NULL)
{
if (v->dest->fv != v->src->fv)
-
st_bare_pad_len_copy
(case_data_rw (c, v->dest->fv)->s,
-
case_str (c, v->src->fv)
,
-
v->dest->width
, v->src->width);
+
buf_copy_rpad
(case_data_rw (c, v->dest->fv)->s,
+
v->dest->width
,
+
case_str (c, v->src->fv)
, v->src->width);
}
else
memcpy (case_data_rw (c, v->dest->fv)->s, cp->t.c, v->dest->width);
}
else
memcpy (case_data_rw (c, v->dest->fv)->s, cp->t.c, v->dest->width);