[PATCH 0/2] simplifying !RUNTIME_PREFIX
- From
Jeff King <peff@peff.net>
- Date
- Sep 6, 2017, 12:28 UTC
- Message-ID
- <20170906122834.s7a6je4b7casdfxx@sigill.intra.peff.net>
- In-Reply-To
- <xmqqd174a9hs.fsf@gitster.mtv.corp.google.com>
On Wed, Sep 06, 2017 at 10:42:07AM +0900, Junio C Hamano wrote:
Show 7 quoted lines
> Jeff King <peff@peff.net> writes: > > > In fact, the whole extract_argv0_path thing is pointless without > > RUNTIME_PREFIX. So I think one reasonable fix is just: > [...] > Yeah, I kind of like this (I would have reduced the ifdef noise by > leaving a totally-unused argv0_path in the BSS, though).
I wanted to drop it to make sure that I didn't miss any references to it (and that we didn't add any in the future). But -Wunused also complains if you leave it in. :)
I think we can reorganize the code a little to make the end result more readable. Like this.
[1/2]: system_path: move RUNTIME_PREFIX to a sub-function [2/2]: git_extract_argv0_path: do nothing without RUNTIME_PREFIX
exec_cmd.c | 42 ++++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-)
-Peff