remove unused function got_path_get_absolute(); realpath(3) is usually better
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
diff --git a/include/got_path.h b/include/got_path.h
index 0219d3d..f2d6ba2 100644
--- a/include/got_path.h
+++ b/include/got_path.h
@@ -27,12 +27,6 @@ struct dirent;
int got_path_is_absolute(const char *);
/*
- * Return an absolute version of a relative path.
- * The result is allocated with malloc(3).
- */
-char *got_path_get_absolute(const char *);
-
-/*
* Canonicalize absolute paths by removing redundant path separators
* and resolving references to parent directories ("/../").
* Relative paths are copied from input to buf as-is.
diff --git a/lib/path.c b/lib/path.c
index 54f8f6f..d94d085 100644
--- a/lib/path.c
+++ b/lib/path.c
@@ -43,21 +43,6 @@ got_path_is_absolute(const char *path)
return path[0] == '/';
}
-char *
-got_path_get_absolute(const char *relpath)
-{
- char cwd[PATH_MAX];
- char *abspath;
-
- if (getcwd(cwd, sizeof(cwd)) == NULL)
- return NULL;
-
- if (asprintf(&abspath, "%s/%s/", cwd, relpath) == -1)
- return NULL;
-
- return abspath;
-}
-
/* based on canonpath() from kern_pledge.c */
const struct got_error *
got_canonpath(const char *input, char *buf, size_t bufsize)