diff options
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | 2007-08-01 01:28:59 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-08-01 00:38:30 -0700 |
commit | e5392c51469c25851f9c6e53165d75fc61901768 (patch) | |
tree | 9fc9e6a7b22c40694e5bb6994c599da1a159d96e /cache.h | |
parent | 73a7a65663223d08d8cabac8d873de21b7e9678d (diff) | |
download | git-e5392c51469c25851f9c6e53165d75fc61901768.tar.gz git-e5392c51469c25851f9c6e53165d75fc61901768.tar.xz |
Add is_absolute_path() and make_absolute_path()
This patch adds convenience functions to work with absolute paths.
The function is_absolute_path() should help the efforts to integrate
the MinGW fork.
Note that make_absolute_path() returns a pointer to a static buffer.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r-- | cache.h | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -358,6 +358,11 @@ int git_config_perm(const char *var, const char *value); int adjust_shared_perm(const char *path); int safe_create_leading_directories(char *path); char *enter_repo(char *path, int strict); +static inline int is_absolute_path(const char *path) +{ + return path[0] == '/'; +} +const char *make_absolute_path(const char *path); /* Read and unpack a sha1 file into memory, write memory to a sha1 file */ extern int sha1_object_info(const unsigned char *, unsigned long *); |