]> git.ipfire.org Git - pakfire.git/commitdiff
util: Drop unused pakfire_path_abspath function
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 2 Sep 2023 10:03:35 +0000 (10:03 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 2 Sep 2023 10:03:35 +0000 (10:03 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/include/pakfire/util.h
src/libpakfire/util.c

index 184f1558d0bbed6ca0763ebde4ddf59a63052d20..ef835a112076f7dee5fb6be530ea425e354edece 100644 (file)
@@ -65,7 +65,6 @@ int __pakfire_unhexlify(unsigned char* dst, const size_t l, const char* src);
 int __pakfire_path_join(char* dest, const size_t length,
        const char* first, const char* second);
 int pakfire_path_is_absolute(const char* path);
-const char* pakfire_path_abspath(const char* path);
 const char* pakfire_path_relpath(const char* root, const char* path);
 
 #define pakfire_path_realpath(dest, path) \
index 090be50e19ef3137efc0bd5cceb665b29b77e9f5..3fb0b42079e79594872a9067e371164d3bf6248f 100644 (file)
@@ -103,29 +103,6 @@ int pakfire_path_is_absolute(const char* path) {
        return (*path == '/');
 }
 
-const char* pakfire_path_abspath(const char* path) {
-       static char buffer[PATH_MAX];
-       int r;
-
-       // Check input
-       if (!path) {
-               errno = EINVAL;
-               return NULL;
-       }
-
-       // Return path if already absolute
-       if (*path == '/')
-               return path;
-
-       // Otherwise prepend a /
-       r = pakfire_string_format(buffer, "/%s", path);
-       if (r)
-               return NULL;
-
-       // Return a reference to the buffer
-       return buffer;
-}
-
 const char* pakfire_path_relpath(const char* root, const char* path) {
        // Check inputs
        if (!root || !path) {