#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 by , 15 years ago
| Keywords: | emxomfar added |
|---|---|
| Status: | new → assigned |
comment:2 by , 15 years ago
comment:3 by , 15 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
comment:4 by , 14 years ago
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.

(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.