diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2019-01-06 19:58:18 +0100 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2019-01-06 19:58:18 +0100 |
| commit | 2d9e09796342ab202e780a6cb613b532c7356aec (patch) | |
| tree | d164fa2dc78c68b363bd6d7a0bd47e1569a4004e | |
| parent | 3f4fac577a83146ac69bf617a29cf192099cded0 (diff) | |
| download | busybox-w32-2d9e09796342ab202e780a6cb613b532c7356aec.tar.gz busybox-w32-2d9e09796342ab202e780a6cb613b532c7356aec.tar.bz2 busybox-w32-2d9e09796342ab202e780a6cb613b532c7356aec.zip | |
find: handle leading -- argument
function old new delta
find_main 464 478 +14
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| -rw-r--r-- | findutils/find.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/findutils/find.c b/findutils/find.c index 6407c6c5a..06ad1b39c 100644 --- a/findutils/find.c +++ b/findutils/find.c | |||
| @@ -1467,6 +1467,12 @@ int find_main(int argc UNUSED_PARAM, char **argv) | |||
| 1467 | break; | 1467 | break; |
| 1468 | if (!saved[1]) | 1468 | if (!saved[1]) |
| 1469 | break; /* it is "-" */ | 1469 | break; /* it is "-" */ |
| 1470 | if (saved[1] == '-' && !saved[2]) { | ||
| 1471 | /* it is "--" */ | ||
| 1472 | /* Try: find -- /dev/null */ | ||
| 1473 | saved = *++past_HLP; | ||
| 1474 | break; | ||
| 1475 | } | ||
| 1470 | if ((saved+1)[strspn(saved+1, "HLP")] != '\0') | 1476 | if ((saved+1)[strspn(saved+1, "HLP")] != '\0') |
| 1471 | break; | 1477 | break; |
| 1472 | } | 1478 | } |
