From c63b9114455a67a23986fb62035a1ff2a0573588 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Wed, 14 Mar 2012 19:56:30 +0100 Subject: [PATCH] Recode Dialog: Stringify the variable label Ensure that the generated syntax has quotes around the variable label, in case the label happens to contain spaces or other metacharacters. --- src/ui/gui/recode-dialog.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/ui/gui/recode-dialog.c b/src/ui/gui/recode-dialog.c index 97a25cf232..012b2f26c1 100644 --- a/src/ui/gui/recode-dialog.c +++ b/src/ui/gui/recode-dialog.c @@ -1078,8 +1078,15 @@ generate_syntax (const struct recode_dialog *rd) while (g_hash_table_iter_next (&iter, (void**) &var, (void**) &nlp)) { if (nlp->label) - g_string_append_printf (str, "\nVARIABLE LABELS %s %s.", - nlp->name, nlp->label); + { + struct string sl; + ds_init_empty (&sl); + syntax_gen_string (&sl, ss_cstr (nlp->label)); + g_string_append_printf (str, "\nVARIABLE LABELS %s %s.", + nlp->name, ds_cstr (&sl)); + + ds_destroy (&sl); + } } } -- 2.30.2