Is it really needed to declare those variables outside of a function
in this case? This scheme makes difficult reusing the code from other
builtins, rewriting it for libification, calling it many times, or
even understand if they were declared that way with a purpose or not.
I just don't know why they are that way in this case, is there a
reason for it?
Actually I don't care either way, but in my last rebase on next this
I realize that static variables will be automatically initialized to
zero so this is unnecessary, but is there some technical reason not to
initialize explicitly? If the answer is simply a style preference that
is fine, I'm just here to learn.
Of course as already pointed out these don't actually need to be static
in the first place so I'll simply move them into cmd_clean(). This does
lead me to another question though. Now that Dscho has converted my
patch to use parse-options, what is the best way to update my patch
while still giving credit to Dscho?
Both readability and style have to do much with this.
The style has a historical background which is a slight
technical merit. It results in a smaller executable file, as C
compilers traditionally placed file-scope static variables that
are not explicitly initialized in the BSS section, instead of
explicitly storing N-bytes of zero as the the initial data in it
(although I do not see a reason for compilers not to do the same
for variables explicitly initialized to zero. In fact, I think
modern gcc produces the same allocation with or without "= 0"
Please send a rewritten replacement version as a single patch
that is cleanly applicable to 'next', and mention people whose
input helped you in polishing the patch in the proposed commit