[libgsf] gsf: allow using "-" for creating archives sent to stdout.



commit c2888e8fa0f5d868d41ed2ca911d1028a4e9ab93
Author: Morten Welinder <terra gnome org>
Date:   Tue Dec 2 20:38:39 2014 -0500

    gsf: allow using "-" for creating archives sent to stdout.

 ChangeLog   |    2 ++
 tools/gsf.c |    5 ++++-
 2 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 8a036ea..37ec1dc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2014-12-02  Morten Welinder  <terra gnome org>
 
+       * tools/gsf.c (gsf_create): Allow "-" for output to stdout.
+
        * tests/LibGsfTest.pm (test_valgrind): Dump valgrind output when
        verbose.
 
diff --git a/tools/gsf.c b/tools/gsf.c
index 5e4cc13..ba148cc 100644
--- a/tools/gsf.c
+++ b/tools/gsf.c
@@ -468,7 +468,10 @@ gsf_create (int argc, char **argv, GType type)
                return 1;
 
        filename = argv[0];
-       dest = gsf_output_stdio_new (filename, &error);
+       if (strcmp (filename, "-") == 0)
+               dest = gsf_output_stdio_new_FILE (filename, stdout, TRUE);
+       else
+               dest = gsf_output_stdio_new (filename, &error);
        if (error) {
                show_error (filename, error);
                return 1;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]