summaryrefslogtreecommitdiff
path: root/gfx
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-09-03 16:24:18 (GMT)
committerWerner Almesberger <werner@almesberger.net>2016-09-03 22:18:29 (GMT)
commitc8b5418ada13b5e30a524b7f87d50865bef27f30 (patch)
tree24c902e744040ac13d0de97179b529146a0b0f3d /gfx
parent45d0e26e83947644064934e8a620ce9b7720fa03 (diff)
downloadeeshow-c8b5418ada13b5e30a524b7f87d50865bef27f30.zip
eeshow-c8b5418ada13b5e30a524b7f87d50865bef27f30.tar.gz
eeshow-c8b5418ada13b5e30a524b7f87d50865bef27f30.tar.bz2
gfx/cro.c, gfx/fig.c: output file name - means standard output
Diffstat (limited to 'gfx')
-rw-r--r--gfx/cro.c6
-rw-r--r--gfx/fig.c2
2 files changed, 4 insertions, 4 deletions
diff --git a/gfx/cro.c b/gfx/cro.c
index 11b482a..9dd57de 100644
--- a/gfx/cro.c
+++ b/gfx/cro.c
@@ -622,7 +622,7 @@ static bool cr_pdf_args(void *ctx, int argc, char *const *argv)
if (!cr_args(cc, argc, argv))
return 0;
- if (cc->add_toc && cc->output_name)
+ if (cc->add_toc && cc->output_name && strcmp(cc->output_name, "-"))
return pdftoc_set_file(cc->toc, cc->output_name);
return 1;
}
@@ -662,7 +662,7 @@ static int cr_pdf_end(void *ctx)
if (cc->toc)
cc->s = cairo_pdf_surface_create_for_stream(stream_to_pdftoc,
cc, w, h);
- else if (cc->output_name)
+ else if (cc->output_name && strcmp(cc->output_name, "-"))
cc->s = cairo_pdf_surface_create(cc->output_name, w, h);
else
cc->s = cairo_pdf_surface_create_for_stream(stream_to_stdout,
@@ -774,7 +774,7 @@ void cro_img_write(cairo_surface_t *s, const char *name)
{
cairo_status_t status;
- if (name)
+ if (name && strcmp(name, "-"))
status = cairo_surface_write_to_png(s, name);
else
status = cairo_surface_write_to_png_stream(s, stream_to_stdout,
diff --git a/gfx/fig.c b/gfx/fig.c
index 36e6a7c..8ae7721 100644
--- a/gfx/fig.c
+++ b/gfx/fig.c
@@ -323,7 +323,7 @@ static bool fig_args(void *ctx, int argc, char *const *argv)
if (argc != optind)
usage(*argv);
- if (output) {
+ if (output && strcmp(output, "-")) {
fig->file = fopen(output, "w");
if (!fig->file)
diag_pfatal(output);