Commit 49aa539ae942aff06b21e3252bed3977e80398e3

Stefan Sperling 2019-07-22T10:41:16

remove got_path_normalize(); pointless and unused

diff --git a/include/got_path.h b/include/got_path.h
index 0930f71..588e227 100644
--- a/include/got_path.h
+++ b/include/got_path.h
@@ -28,12 +28,6 @@ int got_path_is_absolute(const char *);
  */
 char *got_path_get_absolute(const char *);
 
-/* 
- * Normalize a path for internal processing.
- * The result is allocated with malloc(3).
- */
-char *got_path_normalize(const char *);
-
 /*
  * Canonicalize absolute paths by removing redundant path separators
  * and resolving references to parent directories ("/../").
diff --git a/lib/path.c b/lib/path.c
index fb283d4..8d2ef33 100644
--- a/lib/path.c
+++ b/lib/path.c
@@ -58,24 +58,6 @@ got_path_get_absolute(const char *relpath)
 	return abspath;
 }
 
-char *
-got_path_normalize(const char *path)
-{
-	char *resolved;
-
-	resolved = realpath(path, NULL);
-	if (resolved == NULL)
-		return NULL;
-	
-	if (!got_path_is_absolute(resolved)) {
-		char *abspath = got_path_get_absolute(resolved);
-		free(resolved);
-		resolved = abspath;
-	}
-
-	return resolved;
-}
-
 /* based on canonpath() from kern_pledge.c */
 const struct got_error *
 got_canonpath(const char *input, char *buf, size_t bufsize)