[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Patch] Remove unnecessary check in mkdir_builtin

From: Adam Richter
Subject: [Patch] Remove unnecessary check in mkdir_builtin
Date: Fri, 24 May 2019 01:33:46 -0700

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.


Attachment: bash-5.0.mkdir.diff
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]