pivot-table: Honor blank variable labels.
[pspp] / src / data / variable.c
index 87e7d07823f42271707000938d7501a24f562250..4fdfdcbb65d83609b14f8f29b14bf1ffe6b0741a 100644 (file)
@@ -760,23 +760,20 @@ var_get_label (const struct variable *v)
 
 /* Sets V's variable label to UTF-8 encoded string LABEL, stripping off leading
    and trailing white space.  If LABEL is a null pointer or if LABEL is an
-   empty string (after stripping white space), then V's variable label (if any)
-   is removed. */
+   empty string, then V's variable label (if any) is removed. */
 static void
 var_set_label_quiet (struct variable *v, const char *label)
 {
   free (v->label);
   v->label = NULL;
 
-  if (label != NULL && label[strspn (label, CC_SPACES)])
+  if (label != NULL && label[0])
     v->label = xstrdup (label);
 
   ds_destroy (&v->name_and_label);
   ds_init_empty (&v->name_and_label);
 }
 
-
-
 /* Sets V's variable label to UTF-8 encoded string LABEL, stripping off leading
    and trailing white space.  If LABEL is a null pointer or if LABEL is an
    empty string (after stripping white space), then V's variable label (if any)
@@ -789,7 +786,6 @@ var_set_label (struct variable *v, const char *label)
   dict_var_changed (v, VAR_TRAIT_LABEL, ov);
 }
 
-
 /* Removes any variable label from V. */
 void
 var_clear_label (struct variable *v)