On Wed, 26 Jan 2022 22:50:27 -0600, Scott Cheloha wrote: > The main loop in head(1) is obfuscated. In particular, the path > through the loop to exit(3) is extremely clever. Clever in a bad way. > > This patch moves the open/read/write/close portions of the loop out > into a separate function, head_file(). I think the result is easier > to understand. We only loop in main() if we have file arguments, the > argv[] loop is idiomatic and simple, we actually reach the end of > main(), etc.
OK millert@ - todd
