mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-06-07 06:28:17 +02:00
[output-stream] Accept a NULL filename
Principally to support creating a dummy vector surface (i.e. cairo_ps_surface_create (NULL, 1, 1)) that can be used to determine font extents (or target font options) before opening an output file, but also because we currently fail to do any sanity checking at the entry point.
This commit is contained in:
parent
52ea38f97b
commit
84e4a825ff
1 changed files with 3 additions and 0 deletions
|
|
@ -583,6 +583,9 @@ _cairo_output_stream_create_for_filename (const char *filename)
|
|||
stdio_stream_t *stream;
|
||||
FILE *file;
|
||||
|
||||
if (filename == NULL)
|
||||
return _cairo_null_stream_create ();
|
||||
|
||||
file = fopen (filename, "wb");
|
||||
if (file == NULL) {
|
||||
switch (errno) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue