Re: rev(1): refactor main loop

2022-01-27 Thread Todd C . Miller
On Thu, 27 Jan 2022 08:52:52 -0600, Scott Cheloha wrote: > Just like with head(1), rev(1)'s main loop is obfuscated. > > This patch moves the open/read/write/close portion of the main loop > out of main() into a separate function, rev_file(). "multibyte" > becomes a global. OK millert@ - todd

rev(1): refactor main loop

2022-01-27 Thread Scott Cheloha
Just like with head(1), rev(1)'s main loop is obfuscated. This patch moves the open/read/write/close portion of the main loop out of main() into a separate function, rev_file(). "multibyte" becomes a global. I think the result is easier to understand at a glance. In a subsequent patch I want to