Skip to content

Commit 78c0c9d

Browse files
brongrsto
authored andcommitted
icalvalue: return "" for NO_VALUE if ALLOW_EMPTY_PROPERTIES=true
1 parent e7057ea commit 78c0c9d

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

Diff for: src/libical/icalproperty.c

+5
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,11 @@ const char *icalproperty_as_ical_string(icalproperty *prop)
349349
char *buf;
350350

351351
buf = icalproperty_as_ical_string_r(prop);
352+
#if ICAL_ALLOW_EMPTY_PROPERTIES
353+
/* empty string is set to no-value, per commit b1a9eb33597028b2d160f289b6105f4aa67276a7
354+
* which return NULL as the string value. Convert back to an empty string here */
355+
if (!buf) return "";
356+
#endif
352357
icalmemory_add_tmp_buffer(buf);
353358
return buf;
354359
}

Diff for: src/libical/icalvalue.c

+7
Original file line numberDiff line numberDiff line change
@@ -1247,7 +1247,14 @@ char *icalvalue_as_ical_string_r(const icalvalue *value)
12471247
case ICAL_NO_VALUE:
12481248
default:
12491249
{
1250+
#if ICAL_ALLOW_EMPTY_PROPERTIES
1251+
/* empty string is set to no-value, per
1252+
* commit b1a9eb33597028b2d160f289b6105f4aa67276a7
1253+
* Convert back to an empty string here */
1254+
return icalmemory_strdup("");
1255+
#else
12501256
return 0;
1257+
#endif
12511258
}
12521259
}
12531260
}

0 commit comments

Comments
 (0)