Opened 17 years ago

Closed 13 years ago

Last modified 12 years ago

#184 closed defect (fixed)

emxomfar does not accept '-' before command parameter

Reported by: Yuri Dario Owned by: bird
Priority: normal Milestone: libc-0.6.4
Component: emx Version: 0.6.2
Severity: normal Keywords: emxomfar
Cc:

Description

While ar accepts an optional '-' before the command char, emxomfar doesn't because it checks for -p and then aborts.

Proposed patch ignores also letters for valid commands

Index: emxomfar.c
===================================================================
--- emxomfar.c	(revision 3287)
+++ emxomfar.c	(working copy)
@@ -271,6 +271,11 @@
             usage ();
           ++i;
           break;
+        case 'd':	// also these option can have an optional '-', ignore.
+        case 'r':
+        case 't':
+        case 'x':
+          break;
         default:
           usage ();
         }

Diff is taken from libc 0.6.x tree.

Change History (4)

comment:1 Changed 13 years ago by bird

Keywords: emxomfar added
Status: newassigned

comment:2 Changed 13 years ago by bird

(In [3701]) emxomfar: Fixed and relaxed the command/option parsing so that they can be given with a dash (was broken) and in more than one argument. Should probably insist on the command comming first, but who cares. References #184.

comment:3 Changed 13 years ago by bird

Resolution: fixed
Status: assignedclosed

(In [3702]) 0.6/emxomfar: Backported r3701: Fixed and relaxed the command/option parsing so that they can be given with a dash (was broken) and in more than one argument. Should probably insist on the command comming first, but who cares. Fixes #184.

comment:4 Changed 12 years ago by Yuri Dario

As side effect of fix, now if -p is added to command line, commands must start with a '-' otherwise they are not recognized.

it depends on next option code (line#326):

      /* more options? */

      if (i >= argc)
        usage ();
      s = argv[i];
      if (*s != '-')
        break; /* not an option */
Note: See TracTickets for help on using tickets.