value-labels: Interpret \n as new-line in value labels.
[pspp-builds.git] / src / language / dictionary / sys-file-info.c
index 51b3cae4952933cf7baddaf5d4203a65e3db3cd6..84a4d8e87c604cf64040ad2805ddb2a36b4f41e3 100644 (file)
 
 #include "data/attributes.h"
 #include "data/casereader.h"
+#include "data/dataset.h"
 #include "data/dictionary.h"
 #include "data/file-handle-def.h"
 #include "data/format.h"
 #include "data/missing-values.h"
-#include "data/procedure.h"
 #include "data/sys-file-reader.h"
 #include "data/value-labels.h"
 #include "data/variable.h"
@@ -195,7 +195,7 @@ cmd_display (struct lexer *lexer, struct dataset *ds)
        return CMD_FAILURE;
       if (dict_get_label (dataset_dict (ds)) == NULL)
        tab_output_text (TAB_LEFT,
-                        _("The active file does not have a file label."));
+                        _("The active dataset does not have a file label."));
       else
        {
          tab_output_text (TAB_LEFT | TAT_TITLE, _("File label:"));
@@ -296,14 +296,14 @@ display_documents (const struct dictionary *dict)
   const struct string_array *documents = dict_get_documents (dict);
 
   if (string_array_is_empty (documents))
-    tab_output_text (TAB_LEFT, _("The active file dictionary does not "
+    tab_output_text (TAB_LEFT, _("The active dataset dictionary does not "
                                  "contain any documents."));
   else
     {
       size_t i;
 
       tab_output_text (TAB_LEFT | TAT_TITLE,
-                      _("Documents in the active file:"));
+                      _("Documents in the active dataset:"));
       for (i = 0; i < dict_get_document_line_cnt (dict); i++)
         tab_output_text (TAB_LEFT | TAB_FIX, dict_get_document_line (dict, i));
     }
@@ -584,19 +584,9 @@ describe_variable (const struct variable *v, struct tab_table *t, int r,
       for (i = 0; i < n_labels; i++)
         {
           const struct val_lab *vl = labels[i];
-         char buf[MAX_STRING + 1];
 
-         if (var_is_alpha (v))
-           {
-              int width = var_get_width (v);
-             memcpy (buf, value_str (&vl->value, width), width);
-             buf[width] = 0;
-           }
-         else
-           sprintf (buf, "%g", vl->value.f);
-
-         tab_text (t, 1, r, TAB_NONE, buf);
-         tab_text (t, 2, r, TAB_LEFT, val_lab_get_label (vl));
+         tab_value (t, 1, r, TAB_NONE, &vl->value, v, NULL);
+         tab_text (t, 2, r, TAB_LEFT, val_lab_get_escaped_label (vl));
          r++;
        }
       free (labels);