author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | |
Wed, 1 Aug 2007 00:29:17 +0000 (01:29 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 1 Aug 2007 07:38:30 +0000 (00:38 -0700) | ||
commit | e663674722d8a64a208d8c176d5bfc340c04b964 | |
tree | 65a56b68ff6a1bc7d1eb20ad1b3af9c23c297a10 | tree | snapshot |
parent | e5392c51469c25851f9c6e53165d75fc61901768 | commit | diff |
Add functions get_relative_cwd() and is_inside_dir()
The function get_relative_cwd() works just as getcwd(), only that it
takes an absolute path as additional parameter, returning the prefix
of the current working directory relative to the given path. If the
cwd is no subdirectory of the given path, it returns NULL.
is_inside_dir() is just a trivial wrapper over get_relative_cwd().
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The function get_relative_cwd() works just as getcwd(), only that it
takes an absolute path as additional parameter, returning the prefix
of the current working directory relative to the given path. If the
cwd is no subdirectory of the given path, it returns NULL.
is_inside_dir() is just a trivial wrapper over get_relative_cwd().
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
dir.c | diff | blob | history | |
dir.h | diff | blob | history |