From: Johannes Schindelin Date: Fri, 2 Jan 2009 18:07:52 +0000 (+0100) Subject: git wrapper: Make while loop more reader-friendly X-Git-Tag: v1.6.2-rc0~200 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=cca1704897e7fdb182f68d4c48a437c5d7bc5203;p=git.git git wrapper: Make while loop more reader-friendly It is not a good practice to prefer performance over readability in something as performance uncritical as finding the trailing slash of argv[0]. So avoid head-scratching by making the loop user-readable, and not hyper-performance-optimized. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- diff --git a/git.c b/git.c index 940a49896..e0d907135 100644 --- a/git.c +++ b/git.c @@ -428,9 +428,8 @@ int main(int argc, const char **argv) * name, and the dirname as the default exec_path * if we don't have anything better. */ - do - --slash; - while (cmd <= slash && !is_dir_sep(*slash)); + while (cmd <= slash && !is_dir_sep(*slash)) + slash--; if (cmd <= slash) { *slash++ = 0; git_set_argv0_path(cmd);