return g_string_chunk_insert(chunk, str);
}
+/** Safe insert into GStringChunk. If str is NULL or "\0" inserts nothing and
+ * returns NULL.
+ * @param chunk a GStringChunk
+ * @param str string to add or NULL
+ * @return pointer to the copy of str or NULL if str is NULL
+ */
+static inline gchar *
+cr_safe_string_chunk_insert_null(GStringChunk *chunk, const char *str)
+{
+ if (!str || *str == '\0') return NULL;
+ return g_string_chunk_insert(chunk, str);
+}
+
+
/** Safe const insert into GStringChunk.
* @param chunk a GStringChunk
* @param str string to add or NULL