I think that the following patch is the solution to the `-o -'
        problem, as well as to the one with screwing up one's terminal
        with an accidental `genisoimage foo/'.

  * Refuse to write image to the terminal, unless `-o -' is specified.
  * Make `-o -' an otherwise no-op, since output to stdout is the default
    (closes: #426389)

--- src/cdrkit-1.1.6-debian-1/genisoimage/genisoimage.c 2007-03-17 
17:59:16.000000000 +0600
+++ devel/cdrkit-1.1.6-debian-1-o-dash-fix/genisoimage/genisoimage.c    
2007-11-17 01:42:40.000000000 +0600
@@ -3375,7 +3375,8 @@
                        exit(1);
 #endif
                }
-       } else if (outfile) {
+       } else if (outfile
+                  && strcmp (outfile, "-") != 0) {
                discimage = fopen(outfile, "wb");
                if (!discimage) {
 #ifdef USE_LIBSCHILY
@@ -3406,6 +3407,13 @@
                        }
                        write_jt_header(jttemplate, jtjigdo);
                }
+       } else if (outfile == NULL
+                  && isatty (fileno (stdout))) {
+               /* FIXME: a cleaner way to override this check? */
+               fputs (("image not written to a terminal.\n"
+                       "Use -o - to force the output.\n"),
+                      stderr);
+               exit (1);
        } else {
                discimage = stdout;
 




-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to