find: handle leading -- argument

function                                             old     new   delta
find_main                                            464     478     +14

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2019-01-06 19:58:18 +01:00
parent 3f4fac577a
commit 2d9e097963

View File

@ -1467,6 +1467,12 @@ int find_main(int argc UNUSED_PARAM, char **argv)
break; break;
if (!saved[1]) if (!saved[1])
break; /* it is "-" */ break; /* it is "-" */
if (saved[1] == '-' && !saved[2]) {
/* it is "--" */
/* Try: find -- /dev/null */
saved = *++past_HLP;
break;
}
if ((saved+1)[strspn(saved+1, "HLP")] != '\0') if ((saved+1)[strspn(saved+1, "HLP")] != '\0')
break; break;
} }