X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fdictionary.c;h=467f347efd9f5a5e290435265cbd1077032bfb0b;hb=d8fdf0b4fa919e48397b438e9453d6b82215ff51;hp=2ad94ca4db4de79841daf97cbb338fecf40bacf2;hpb=ca0a72e321421d02a1fd6df943425eff4bd1a257;p=pspp-builds.git diff --git a/src/data/dictionary.c b/src/data/dictionary.c index 2ad94ca4..467f347e 100644 --- a/src/data/dictionary.c +++ b/src/data/dictionary.c @@ -1228,12 +1228,14 @@ dict_get_label (const struct dictionary *d) } /* Sets D's file label to LABEL, truncating it to a maximum of 60 - characters. */ + characters. + + Removes D's label if LABEL is null or the empty string. */ void dict_set_label (struct dictionary *d, const char *label) { free (d->label); - d->label = label != NULL ? xstrndup (label, 60) : NULL; + d->label = label != NULL && label[0] != '\0' ? xstrndup (label, 60) : NULL; } /* Returns the documents for D, or a null pointer if D has no