author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | |
Sun, 27 Jul 2008 20:34:14 +0000 (22:34 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 27 Jul 2008 21:14:38 +0000 (14:14 -0700) | ||
commit | f5d600e2dd8721d7b9177f1c82fe54822d9f1d62 | |
tree | 111721373283921eb86bc684b7f766057719d5fb | tree | snapshot |
parent | b6f637d199fed238179865a38f180fccc37ee8cc | commit | diff |
Avoid chdir() in list_commands_in_dir()
The function list_commands_in_dir() tried to be lazy and just chdir()
to the directory which entries it listed, so that the check if the
file is executable could be done on dir->d_name.
However, there is no good reason to jump around wildly just to find
all Git commands.
Instead, have a strbuf and construct the full path dynamically.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The function list_commands_in_dir() tried to be lazy and just chdir()
to the directory which entries it listed, so that the check if the
file is executable could be done on dir->d_name.
However, there is no good reason to jump around wildly just to find
all Git commands.
Instead, have a strbuf and construct the full path dynamically.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
help.c | diff | blob | history |