Index: usr.bin/find/main.c =================================================================== --- usr.bin/find/main.c +++ usr.bin/find/main.c @@ -53,6 +53,7 @@ #include #include #include +#include #include #include #include @@ -73,6 +74,18 @@ static void usage(void); +static void +do_sort_from_env(void) +{ + const char *p; + + p = getenv("FINDSORT"); + if (p != NULL && *p != '\0') + issort = 1; +} + + + int main(int argc, char *argv[]) { @@ -132,6 +145,8 @@ ftsoptions |= FTS_LOGICAL; } + do_sort_from_env(); + /* * Find first option to delimit the file list. The first argument * that starts with a -, or is a ! or a ( must be interpreted as a