Peter writes:
> Well, this is actually bog-standard getopt(3) behavior...

It is standard getopt() behavior to permute the arguments, whence comes the
bug.  The '+' in the patch below stops it from doing so.  I've also
replaced 'EOF' with '-1' because the latter is what getopt() returns.
'EOF' is a macro which is usually defined as '-1' but is not guaranteed to
be.

--- timelimit-1.3/timelimit.c   2008-09-03 08:24:36.000000000 -0500
+++ timelimit.c 2008-11-11 19:24:36.000000000 -0600
@@ -152,7 +152,7 @@
                }
 
 #ifdef PARSE_CMDLINE
-       while ((ch = getopt(argc, argv, "qS:s:T:t:")) != EOF) {
+       while ((ch = getopt(argc, argv, "+qS:s:T:t:")) != -1) {
                switch (ch) {
                        case 'q':
                                quiet = 1;


-- 
John Hasler 
[EMAIL PROTECTED]
Elmwood, WI USA



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

Reply via email to