yeptris 0.6.32.1-arm-linux-eabihf → 0.6.33.1-arm-linux-eabihf

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -51,6 +51,9 @@ YEPTRIS_API size_t yeptris_serialize_into_ex(YeptrisDocument handle,
51
51
  em.w.p = NULL;
52
52
  em.w.last = 0;
53
53
  em.w.force_flow = 0;
54
+ em.w.in_flow = 0;
55
+ em.w.flow_item = 0;
56
+ em.w.unserializable = 0;
54
57
  em.w.canonical = opts_canonical(opts);
55
58
  em.w.explicit_doc_start = opts_doc_marker(opts);
56
59
  em.w.json = 0;
@@ -116,6 +119,9 @@ YEPTRIS_API char* yeptris_serialize_ex(YeptrisDocument handle, const yeptris_emi
116
119
  em.w.p = NULL;
117
120
  em.w.last = 0;
118
121
  em.w.force_flow = 0;
122
+ em.w.in_flow = 0;
123
+ em.w.flow_item = 0;
124
+ em.w.unserializable = 0;
119
125
  em.w.canonical = opts_canonical(opts);
120
126
  em.w.explicit_doc_start = opts_doc_marker(opts);
121
127
  em.w.json = 0;
@@ -160,7 +166,7 @@ YEPTRIS_API char* yeptris_serialize_ex(YeptrisDocument handle, const yeptris_emi
160
166
  * any growth; every post-run touch goes through the writer's
161
167
  * pointer (the first round's abort was exactly this aliasing) */
162
168
  out = em.w.p;
163
- if (em.w.oom) {
169
+ if (em.w.oom || em.w.unserializable) {
164
170
  free(out);
165
171
  if (em.canon_names.sys != NULL) {
166
172
  yep_nametab_free(&em.canon_names);
@@ -200,6 +206,9 @@ YEPTRIS_API char* yeptris_serialize_json(YeptrisDocument handle, size_t* len) {
200
206
  em.w.p = NULL;
201
207
  em.w.last = 0;
202
208
  em.w.force_flow = 0;
209
+ em.w.in_flow = 0;
210
+ em.w.flow_item = 0;
211
+ em.w.unserializable = 0;
203
212
  em.w.canonical = 0;
204
213
  em.w.explicit_doc_start = 0; /* JSON output carries no --- */
205
214
  em.w.json = 1;
@@ -258,6 +267,9 @@ YEPTRIS_API char* yeptris_serialize_json_ex(YeptrisDocument handle, size_t* len,
258
267
  em.w.p = NULL;
259
268
  em.w.last = 0;
260
269
  em.w.force_flow = 0;
270
+ em.w.in_flow = 0;
271
+ em.w.flow_item = 0;
272
+ em.w.unserializable = 0;
261
273
  em.w.canonical = 0;
262
274
  em.w.explicit_doc_start = 0; /* JSON output carries no --- */
263
275
  em.w.json = 1;
@@ -310,6 +322,9 @@ char* yep_serialize_json_compact(const yeptris_document* doc, size_t* len) {
310
322
  em.w.p = NULL;
311
323
  em.w.last = 0;
312
324
  em.w.force_flow = 0;
325
+ em.w.in_flow = 0;
326
+ em.w.flow_item = 0;
327
+ em.w.unserializable = 0;
313
328
  em.w.canonical = 0;
314
329
  em.w.explicit_doc_start = 0; /* JSON output carries no --- */
315
330
  em.w.json = 1;
@@ -362,6 +377,9 @@ char* yep_serialize_json_pretty(const yeptris_document* doc, size_t* len) {
362
377
  em.w.p = NULL;
363
378
  em.w.last = 0;
364
379
  em.w.force_flow = 0;
380
+ em.w.in_flow = 0;
381
+ em.w.flow_item = 0;
382
+ em.w.unserializable = 0;
365
383
  em.w.canonical = 0;
366
384
  em.w.explicit_doc_start = 0; /* JSON output carries no --- */
367
385
  em.w.json = 1;
@@ -430,6 +448,9 @@ YEPTRIS_API size_t yeptris_serialize_stream(YeptrisDocument handle,
430
448
  em.w.p = NULL;
431
449
  em.w.last = 0;
432
450
  em.w.force_flow = 0;
451
+ em.w.in_flow = 0;
452
+ em.w.flow_item = 0;
453
+ em.w.unserializable = 0;
433
454
  em.w.canonical = opts_canonical(opts);
434
455
  em.w.explicit_doc_start = opts_doc_marker(opts);
435
456
  em.w.json = 0;
@@ -19,6 +19,13 @@ int yep_style_plain_safe(const char* p, uint32_t len) {
19
19
  if (is_blank(p[0]) || is_blank(p[len - 1])) {
20
20
  return 0;
21
21
  }
22
+ if (len >= 3 && (unsigned char)p[0] == 0xef && (unsigned char)p[1] == 0xbb &&
23
+ (unsigned char)p[2] == 0xbf) {
24
+ /* a LEADING U+FEFF re-parses as a document BOM and vanishes —
25
+ * the emitted form must carry its escape ("\uFEFF", the
26
+ * nightly's run 38258674337); mid-token BOMs ride plain */
27
+ return 0;
28
+ }
22
29
  switch (p[0]) {
23
30
  case ':':
24
31
  /* libyaml (Psych symbol dumps ":name"): a leading colon only
@@ -119,7 +126,12 @@ int yep_style_plain_safe(const char* p, uint32_t len) {
119
126
  }
120
127
  }
121
128
  /* document markers */
122
- if ((len == 3 && (memcmp(p, "---", 3) == 0 || memcmp(p, "...", 3) == 0))) {
129
+ if (len >= 3 && (memcmp(p, "---", 3) == 0 || memcmp(p, "...", 3) == 0) &&
130
+ (len == 3 || p[3] == ' ' || p[3] == '\t' || p[3] == '\n' || p[3] == '\r')) {
131
+ /* a PREFIX marker is worse than the bare one: emitted plain at
132
+ * line start, "--- ..." re-reads as a document marker (the
133
+ * nightly's "--- --- >" folded-plain crasher) — libyaml quotes
134
+ * both */
123
135
  return 0;
124
136
  }
125
137
  return 1;