[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:
Chris Wilson 2008-10-15 22:15:17 +01:00
parent 52ea38f97b
commit 84e4a825ff

View file

@ -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) {