I remain surprised. If the partially read, unsorted set of filenames exceeds ARG_MAX bytes the shell can infer that exec will fail (E2BIG). There is no need to finish reading the names and sorting them.