summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--abspath.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/abspath.c b/abspath.c
index 91ca00f05f..ff140689ed 100644
--- a/abspath.c
+++ b/abspath.c
@@ -24,6 +24,10 @@ const char *make_absolute_path(const char *path)
char *last_elem = NULL;
struct stat st;
+ /* We've already done it */
+ if (path == buf || path == next_buf)
+ return path;
+
if (strlcpy(buf, path, PATH_MAX) >= PATH_MAX)
die ("Too long path: %.*s", 60, path);