Opened 12 years ago

Closed 8 years ago

Last modified 8 years ago

#184 closed defect (fixed)

emxomfar does not accept '-' before command parameter

Reported by: ydario 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 9 years ago by bird

  • Keywords emxomfar added
  • Status changed from new to assigned

comment:2 Changed 8 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 8 years ago by bird

  • Resolution set to fixed
  • Status changed from assigned to closed

(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 8 years ago by ydario

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.