typo in cairo-xml-surface.c?

Submitted by suzuki toshiya on April 7, 2019, 7:22 a.m.

Details

Message ID 5CA9A1A2.5000907@hiroshima-u.ac.jp
State New
Headers show
Series "typo in cairo-xml-surface.c?" ( rev: 1 ) in Cairo

Not browsing as part of any series.

Commit Message

suzuki toshiya April 7, 2019, 7:22 a.m.
Dear Bryce,

I'm quite sorry for long long latency to post such very trivial
patch, in spite of your positive comment. Here I submit.

Regards,
mpsuzuki

Bryce Harrington wrote:
> On Tue, Dec 18, 2018 at 02:03:44AM +0000, suzuki toshiya wrote:
>> Hi,
>>
>> I found that the output of XML surface contains scaled-font
>> elements without closing tag, like, this:
>>
>> <quote>
>> static cairo_status_t
>> _cairo_xml_emit_scaled_font (cairo_xml_t *xml,
>>                              cairo_scaled_font_t *scaled_font,
>>                              cairo_glyph_t *glyphs,
>>                              int num_glyphs)
>> {
>>     cairo_int_status_t status;
>>
>>     _cairo_xml_printf (xml, "<scaled-font>");
>>     _cairo_xml_indent (xml, 2);
>>
>>     status = _cairo_xml_emit_type42_font (xml, scaled_font);
>>     if (status == CAIRO_INT_STATUS_UNSUPPORTED) {
>>         status = _cairo_xml_emit_type3_font (xml, scaled_font,
>>                                              glyphs, num_glyphs);
>>     }
>>
>>     _cairo_xml_indent (xml, -2);
>>     _cairo_xml_printf (xml, "<scaled-font>");
>>
>>     return status;
>> }
>> </quote>
>>
>> _cairo_xml_emit_scaled_font() emit the opening tag of scaled-font
>> element, but does not emit the closing tag - it emits yet another
>> opening tag.
>>
>> I'm not sure whether the change of the last cairo_xml_printf()
>> from <scaled-font> to </scaled-font> is harmful. Any idea to fix
>> this?
> 
> Good find, I think.  The line appears to have been there since the
> beginning of the xml surface; I'm surprised it was not caught before
> now.
> 
> Would you like to submit a patch to fix the incorrect line?
> 
> Bryce
>

Patch hide | download patch | download mbox

diff --git a/src/cairo-xml-surface.c b/src/cairo-xml-surface.c
index 35773a2b2..43cb6dddf 100644
--- a/src/cairo-xml-surface.c
+++ b/src/cairo-xml-surface.c
@@ -1007,7 +1007,7 @@  _cairo_xml_emit_scaled_font (cairo_xml_t *xml,
     }
 
     _cairo_xml_indent (xml, -2);
-    _cairo_xml_printf (xml, "<scaled-font>");
+    _cairo_xml_printf (xml, "</scaled-font>");
 
     return status;
 }