jbig2dec

Ralph Giles <[email protected]> Fri, 12 Jul 2002 17:32:15 -0700
Newsgroups gmane.comp.printing.ghostscript.jbig2dec.cvs
Message-ID <[email protected]>
Update of /cvsroot/jbig2dec/jbig2dec
In directory usw-pr-cvs1:/tmp/cvs-serv958

Modified Files:
	jbig2dec.c 
Log Message:
Fix up make_output_filename(), improve usage message.


Index: jbig2dec.c
===================================================================
RCS file: /cvsroot/jbig2dec/jbig2dec/jbig2dec.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- jbig2dec.c	13 Jul 2002 00:03:52 -0000	1.30
+++ jbig2dec.c	13 Jul 2002 00:32:13 -0000	1.31
@@ -60,12 +60,13 @@
     "  embedded streams.\n"
     "\n"
     "  available options:\n"
+    "    -h --help	this usage summary\n"
     "    -q --quiet     suppress diagnostic output\n"
-    "    -d --dump      print the structure of the jbig2 file,\n"
+    "    -d --dump      print the structure of the jbig2 file\n"
     "                   rather than explicitly decoding\n"
-    "    -o <file>	send decoded output to <file>. defaults to the same\n"
-    " 			filename as the input with a different extension.\n"
-    "    -h --help	this usage summary.\n"
+    "    -o <file>	send decoded output to <file>\n"
+    "                   Defaults to the the input with a different\n"
+    "                   extension. Pass '-' for stdout.\n"
     "\n"
   );
   
@@ -156,18 +157,20 @@
     }
     
     if (input_filename == NULL)
-      output_filename = "out";
-      
-    /* strip any leading path */
-    c = strrchr(input_filename, '/'); /* *nix */
-    if (c == NULL)
-      c = strrchr(input_filename, '\\'); /* win32/dos */
-    if (c != NULL)
-      c++; /* skip the path separator */
-    else
-      c = input_filename; /* no leading path */
+      c = "out";
+    else {  
+      /* strip any leading path */
+      c = strrchr(input_filename, '/'); /* *nix */
+      if (c == NULL)
+        c = strrchr(input_filename, '\\'); /* win32/dos */
+      if (c != NULL)
+        c++; /* skip the path separator */
+      else
+        c = input_filename; /* no leading path */
+    }
+
     /* make sure we haven't just stripped the last character */
-    if (*c = '\0')
+    if (*c == '\0')
       c = "out";
         
     /* strip the extension */
@@ -225,9 +228,6 @@
   jbig2dec_params_t params = {render,1,NULL};
   int filearg;
 
-  fprintf(stderr, "heisenbug detector: %s\n", make_output_filename(NULL, ".out"));
-  
-  
   filearg = parse_options(argc, argv, &params);
 
   switch (params.mode) {