summaryrefslogtreecommitdiff
path: root/abspath.c
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2012-10-28 16:16:22 (GMT)
committerJeff King <peff@peff.net>2012-10-29 06:34:58 (GMT)
commite3e46cdbd45c2e7383df9de1787e23489dc66dbc (patch)
treead73b04f0a16f9c707f26d20a41ce87dddc64502 /abspath.c
parentd6052abca39fc84fed4f3248be042cfb6bf635d5 (diff)
downloadgit-e3e46cdbd45c2e7383df9de1787e23489dc66dbc.zip
git-e3e46cdbd45c2e7383df9de1787e23489dc66dbc.tar.gz
git-e3e46cdbd45c2e7383df9de1787e23489dc66dbc.tar.bz2
Introduce new function real_path_if_valid()
The function is like real_path(), except that it returns NULL on error instead of dying. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Jeff King <peff@peff.net>
Diffstat (limited to 'abspath.c')
-rw-r--r--abspath.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/abspath.c b/abspath.c
index f8a526f..40cdc46 100644
--- a/abspath.c
+++ b/abspath.c
@@ -153,6 +153,11 @@ const char *real_path(const char *path)
return real_path_internal(path, 1);
}
+const char *real_path_if_valid(const char *path)
+{
+ return real_path_internal(path, 0);
+}
+
static const char *get_pwd_cwd(void)
{
static char cwd[PATH_MAX + 1];