X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fapply-dict.c;h=473daf0148981f3c8367b813071b1ad645063a94;hb=1f8dd363d6c20d07fcca14cb948018465fa5ed8b;hp=74c1642b96df8f466a978d27abd2ef6134936e62;hpb=4de79b34b329d1da6cdeb145993d3efd911e2967;p=pspp-builds.git diff --git a/src/apply-dict.c b/src/apply-dict.c index 74c1642b..473daf01 100644 --- a/src/apply-dict.c +++ b/src/apply-dict.c @@ -129,31 +129,18 @@ cmd_apply_dictionary (void) } } - if (s->miss_type != MISSING_NONE && t->width > MAX_SHORT_STRING) + if (!mv_is_empty (&s->miss) && t->width > MAX_SHORT_STRING) msg (SW, _("Cannot apply missing values from source file to " "long string variable %s."), s->name); - else if (s->miss_type != MISSING_NONE) + else if (!mv_is_empty (&s->miss)) { - if (t->width < s->width) - { - static const int miss_count[MISSING_COUNT] = - { - 0, 1, 2, 3, 2, 1, 1, 3, 2, 2, - }; - - int j, k; - - for (j = 0; j < miss_count[s->miss_type]; j++) - for (k = t->width; k < s->width; k++) - if (s->missing[j].s[k] != ' ') - goto skip_missing_values; - } - - t->miss_type = s->miss_type; - memcpy (t->missing, s->missing, sizeof s->missing); + if (mv_is_resizable (&s->miss, t->width)) + { + mv_copy (&t->miss, &s->miss); + mv_resize (&t->miss, t->width); + } } - skip_missing_values: ; if (s->type == NUMERIC) {