From 3444d934754fcc305af29a8c05f19792c77b89e2 Mon Sep 17 00:00:00 2001 From: Alessandro Zummo Date: Tue, 8 Dec 2009 22:27:43 -0500 Subject: [PATCH] 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. --- src/merge-text.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); -- 2.39.5