OSDN Git Service

More cmp.c shrinkage.
authorRob Landley <rob@landley.net>
Wed, 8 Feb 2012 04:25:59 +0000 (22:25 -0600)
committerRob Landley <rob@landley.net>
Wed, 8 Feb 2012 04:25:59 +0000 (22:25 -0600)
commitf7c1de35882f1f6eddada222efd798f0b66b6dcf
tree33b51ce5f525648763de62e453cde7a0f991f165
parente0bd691bdf3f1ce19dcebfe46d830a0fc408e3d5
More cmp.c shrinkage.

Abuse loopfiles() to handle both arguments, caching the first pass in globals.
That eliminates get_fd() since loopfiles already knows how to handle "-" arg.
Chop toybuf in half and use half for each file, eliminating malloc/free.
main() becomes just a call to loopfiles(), which does all open/close.
toys/cmp.c