From: Alessandro Zummo Date: Wed, 9 Dec 2009 03:27:43 +0000 (-0500) Subject: Allow merge source to be stdin X-Git-Tag: glabels-2_3_0~117 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3444d934754fcc305af29a8c05f19792c77b89e2;p=glabels Allow merge source to be stdin Use the filename "-" to indicate that the merge source is to be taken from standard input (stdin). This is primarily intended for the glabels-batch program. --- diff --git a/src/merge-text.c b/src/merge-text.c index e23803e9..c42cd3f7 100644 --- a/src/merge-text.c +++ b/src/merge-text.c @@ -340,7 +340,11 @@ gl_merge_text_open (glMerge *merge) if (src != NULL) { - merge_text->priv->fp = fopen (src, "r"); + if (g_utf8_strlen(src, -1) == 1 && src[0] == '-') + merge_text->priv->fp = stdin; + else + merge_text->priv->fp = fopen (src, "r"); + g_free (src); clear_keys (merge_text);