about summary refs log tree commit diff
path: root/other
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2007-09-03 17:25:21 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2007-09-03 17:25:21 +0000
commitc5b69ed7dadf8de4b1d19cc7617172a0390c1586 (patch)
treeab4e0050882c24e7fca9f402621bb24ce7e8bb7a /other
parent8d52ce5e21903e601e6bda24ad715b4a77259009 (diff)
downloadnetpbm-mirror-c5b69ed7dadf8de4b1d19cc7617172a0390c1586.tar.gz
netpbm-mirror-c5b69ed7dadf8de4b1d19cc7617172a0390c1586.tar.xz
netpbm-mirror-c5b69ed7dadf8de4b1d19cc7617172a0390c1586.zip
Release 10.35.31
git-svn-id: http://svn.code.sf.net/p/netpbm/code/stable@399 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'other')
-rw-r--r--other/pamstack.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/other/pamstack.c b/other/pamstack.c
index 4f8d9945..d9691f74 100644
--- a/other/pamstack.c
+++ b/other/pamstack.c
@@ -15,6 +15,7 @@
 #include <string.h>
 
 #include "mallocvar.h"
+#include "nstring.h"
 #include "shhopt.h"
 #include "pam.h"
 
@@ -72,16 +73,23 @@ parseCommandLine(int argc, char ** argv,
 
     cmdlineP->nInput = 0;  /* initial value */
     { 
-        int argn;
-        for (argn = 1; argn < argc; argn++) {
+        unsigned int argn;
+        bool stdinUsed;
+        for (argn = 1, stdinUsed = false; argn < argc; ++argn) {
             if (cmdlineP->nInput >= MAX_INPUTS) 
-                pm_error("You may not specify more than %d input images.",
+                pm_error("You may not specify more than %u input images.",
                          MAX_INPUTS);
             cmdlineP->inputFileName[cmdlineP->nInput++] = argv[argn];
+            if (streq(argv[argn], "-")) {
+                if (stdinUsed)
+                    pm_error("You cannot specify Standard Input ('-') "
+                             "for more than one input file");
+                stdinUsed = true;
+            }
         }
     }
     if (cmdlineP->nInput < 1)
-        pm_error("You must specify at least one input PAM image.");
+        cmdlineP->inputFileName[cmdlineP->nInput++] = "-";
 }