From: Friedrich Beckmann Date: Thu, 21 Nov 2024 12:25:10 +0000 (+0100) Subject: import assistant: fix variable width after guesser with output constraints X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a32b9446ea1260d23f1415798eaaced92c399395;p=pspp import assistant: fix variable width after guesser with output constraints The current code fixes the guessed variable width according to input constraints. But the data output stages checks the width against output constraints. The minimum width for FMT_E is 1 for input and 6 for output. When the guesser proposes FMT_E with width 5, then 5 is chosen. With this patch, the width is fixed to 6. Thanks to Fatemeh Ilkhani for reporting the bug and providing a csv that triggers the crash. Closes: https://savannah.gnu.org/bugs/?66456 --- diff --git a/src/ui/gui/psppire-import-textfile.c b/src/ui/gui/psppire-import-textfile.c index 95251c7324..3257d439e1 100644 --- a/src/ui/gui/psppire-import-textfile.c +++ b/src/ui/gui/psppire-import-textfile.c @@ -697,7 +697,7 @@ textfile_create_reader (PsppireImportAssistant *ia) { struct fmt_spec fs = fmt_guesser_guess (fg[i]); - fmt_fix (&fs, FMT_FOR_INPUT); + fmt_fix (&fs, FMT_FOR_OUTPUT); struct variable *var = dict_get_var (ia->dict, i);