summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--abspath.c5
-rw-r--r--cache.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/abspath.c b/abspath.c
index f8a526f391..40cdc46219 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];
diff --git a/cache.h b/cache.h
index a58df84bd3..b0d75bcb0e 100644
--- a/cache.h
+++ b/cache.h
@@ -714,6 +714,7 @@ static inline int is_absolute_path(const char *path)
}
int is_directory(const char *);
const char *real_path(const char *path);
+const char *real_path_if_valid(const char *path);
const char *absolute_path(const char *path);
const char *relative_path(const char *abs, const char *base);
int normalize_path_copy(char *dst, const char *src);