output-item: Make command name part of every output_item.
[pspp] / src / output / output-item-provider.h
index 7517996119112faa2d683dde6d6522d01b492595..62e756155951d817f8b63ed4b1cc11d82434ce0b 100644 (file)
@@ -17,6 +17,7 @@
 #ifndef OUTPUT_ITEM_PROVIDER_H
 #define OUTPUT_ITEM_PROVIDER_H 1
 
+#include "libpspp/str.h"
 #include "output/output-item.h"
 
 /* Class structure for an output item.
@@ -40,7 +41,8 @@ struct output_item_class
   {                                                             \
     .class = (SRC)->class,                                      \
     .ref_cnt = 1,                                               \
-    .label = (SRC)->label ? xstrdup ((SRC)->label) : NULL,      \
+    .label = xstrdup_if_nonnull ((SRC)->label),                 \
+    .command_name = xstrdup_if_nonnull ((SRC)->command_name),   \
   }
 
 #endif /* output/output-item-provider.h */