projects
/
pspp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
53367c0
)
AUTORECODE: Do not create value labels when they would be empty.
author
Ben Pfaff
<blp@cs.stanford.edu>
Sun, 1 Sep 2019 19:23:02 +0000
(19:23 +0000)
committer
Ben Pfaff
<blp@cs.stanford.edu>
Sun, 1 Sep 2019 19:33:37 +0000
(19:33 +0000)
src/language/stats/autorecode.c
patch
|
blob
|
history
diff --git
a/src/language/stats/autorecode.c
b/src/language/stats/autorecode.c
index e5ab8070d7499c7fa6ba2fe2afc86ae19cec67e1..66afb13afaba92e5df8791048292b279539c98ce 100644
(file)
--- a/
src/language/stats/autorecode.c
+++ b/
src/language/stats/autorecode.c
@@
-324,9
+324,12
@@
cmd_autorecode (struct lexer *lexer, struct dataset *ds)
while (len > 0 && recoded_value[len - 1] == ' ')
recoded_value[--len] = '\0';
- /* Add value label. */
- union value to_val = { .f = items[j]->to };
- var_add_value_label (spec->dst, &to_val, recoded_value);
+ /* Add value label, if it would be nonempty. */
+ if (len)
+ {
+ union value to_val = { .f = items[j]->to };
+ var_add_value_label (spec->dst, &to_val, recoded_value);
+ }
free (recoded_value);
}