This second trivial patch fixes another cppcheck complaint. Don't worry. I'm not am not submitting a flood of rivial patches right now. I am only submitting these two right now, and I split them in two only because they are so unrelated to each other.
In the pristine ftp.gnu.org version of bash-5.0, the file examples/loadables/mkdir.c contains the function mkdir_builtin, which has a multi-branch "if" statement, which tests a condition that was already tested at the beginning of the "if" statement and does not provide an unconditional "else" statement at the end. This lead cppcheck to wonder if a variable set in each of these branches could possibly be uninitialized afterwards. This patch deletes the duplicative test, which at least should make any real bug in the future that cppcheck may flag a little more apparent. On the x86_64 and i686 configurations that I tried, the resulting stripped mkdir.o file was the same with and without this change. I hereby release any copyright interest I may have in this trivial patch into the public domain. Adam
diff --git a/examples/loadables/mkdir.c b/examples/loadables/mkdir.c index b381119..8133cdb 100644 --- a/examples/loadables/mkdir.c +++ b/examples/loadables/mkdir.c @@ -93,7 +93,7 @@ mkdir_builtin (list) return (EXECUTION_FAILURE); } } - else if (mode) + else { /* initial bits are a=rwx; the mode argument modifies them */ omode = parse_symbolic_mode (mode, S_IRWXU | S_IRWXG | S_IRWXO);