diff options
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | 2009-01-02 19:07:52 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-01-02 13:19:40 -0800 |
commit | cca1704897e7fdb182f68d4c48a437c5d7bc5203 (patch) | |
tree | 7ccf394b2e80536442703e0013bf0dde86547e08 /git.c | |
parent | 3827210b91a7d363ea67bcf0b9c6ee1c91d2f3c5 (diff) | |
download | git-cca1704897e7fdb182f68d4c48a437c5d7bc5203.tar.gz git-cca1704897e7fdb182f68d4c48a437c5d7bc5203.tar.xz |
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 <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git.c')
-rw-r--r-- | git.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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); |