diff options
-rw-r--r-- | findutils/find.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/findutils/find.c b/findutils/find.c index 2235b5049..d4b7c8ec8 100644 --- a/findutils/find.c +++ b/findutils/find.c | |||
@@ -231,12 +231,13 @@ | |||
231 | //kbuild:lib-$(CONFIG_FIND) += find.o | 231 | //kbuild:lib-$(CONFIG_FIND) += find.o |
232 | 232 | ||
233 | //usage:#define find_trivial_usage | 233 | //usage:#define find_trivial_usage |
234 | //usage: "[PATH]... [OPTIONS] [ACTIONS]" | 234 | //usage: "[-HL] [PATH]... [OPTIONS] [ACTIONS]" |
235 | //usage:#define find_full_usage "\n\n" | 235 | //usage:#define find_full_usage "\n\n" |
236 | //usage: "Search for files and perform actions on them.\n" | 236 | //usage: "Search for files and perform actions on them.\n" |
237 | //usage: "First failed action stops processing of current file.\n" | 237 | //usage: "First failed action stops processing of current file.\n" |
238 | //usage: "Defaults: PATH is current directory, action is '-print'\n" | 238 | //usage: "Defaults: PATH is current directory, action is '-print'\n" |
239 | //usage: "\n -follow Follow symlinks" | 239 | //usage: "\n -L,-follow Follow symlinks" |
240 | //usage: "\n -H ...on command line only" | ||
240 | //usage: IF_FEATURE_FIND_XDEV( | 241 | //usage: IF_FEATURE_FIND_XDEV( |
241 | //usage: "\n -xdev Don't descend directories on other filesystems" | 242 | //usage: "\n -xdev Don't descend directories on other filesystems" |
242 | //usage: ) | 243 | //usage: ) |
@@ -1254,7 +1255,15 @@ int find_main(int argc UNUSED_PARAM, char **argv) | |||
1254 | 1255 | ||
1255 | INIT_G(); | 1256 | INIT_G(); |
1256 | 1257 | ||
1257 | argv++; | 1258 | /* "+": stop on first non-option */ |
1259 | i = getopt32(argv, "+HLP"); | ||
1260 | if (i & (1<<0)) | ||
1261 | G.recurse_flags |= ACTION_FOLLOWLINKS_L0 | ACTION_DANGLING_OK; | ||
1262 | if (i & (1<<1)) | ||
1263 | G.recurse_flags |= ACTION_FOLLOWLINKS | ACTION_DANGLING_OK; | ||
1264 | /* -P is default and is ignored */ | ||
1265 | argv += optind; | ||
1266 | |||
1258 | for (firstopt = 0; argv[firstopt]; firstopt++) { | 1267 | for (firstopt = 0; argv[firstopt]; firstopt++) { |
1259 | if (argv[firstopt][0] == '-') | 1268 | if (argv[firstopt][0] == '-') |
1260 | break; | 1269 | break; |