From 8d05b64fa1b7abb7e46e10eb98f763aa858013e4 Mon Sep 17 00:00:00 2001
From: Richard Nyberg <rnyberg@murmeldjur.se>
Date: Wed, 8 Feb 2006 17:04:44 +0000
Subject: [PATCH] Remove unused function canon_path.

---
 misc/subr.c | 26 --------------------------
 misc/subr.h |  2 --
 2 files changed, 28 deletions(-)

diff --git a/misc/subr.c b/misc/subr.c
index e16a7dc..30b4f3e 100644
--- a/misc/subr.c
+++ b/misc/subr.c
@@ -143,32 +143,6 @@ vfopen(FILE **ret, const char *mode, const char *fmt, ...)
     return err;
 }
 
-int
-canon_path(const char *path, char **res)
-{
-    char rp[PATH_MAX];
-
-    if (realpath(path, rp) == NULL)
-        return errno;
-#if 0
-    // This could be necessary on solaris.
-    if (rp[0] != '/') {
-        char wd[MAXPATHLEN];
-        if (getcwd(wd, MAXPATHLEN) == NULL)
-            return errno;
-        if (strlcat(wd, "/", MAXPATHLEN) >= MAXPATHLEN)
-            return ENAMETOOLONG;
-        if (strlcat(wd, rp, MAXPATHLEN) >= MAXPATHLEN)
-            return ENAMETOOLONG;
-        strcpy(rp, wd);
-    }
-#endif
-    if ((*res = strdup(rp)) == NULL)
-        return ENOMEM;
-
-    return 0;
-}
-
 long
 rand_between(long min, long max)
 {
diff --git a/misc/subr.h b/misc/subr.h
index 0a6223a..1b9c90d 100644
--- a/misc/subr.h
+++ b/misc/subr.h
@@ -20,8 +20,6 @@ void set_bit(uint8_t *bits, unsigned long index);
 int has_bit(const uint8_t *bits, unsigned long index);
 void clear_bit(uint8_t *bits, unsigned long index);
 
-int canon_path(const char *path, char **res);
-
 long rand_between(long min, long max);
 
 int read_fully(int fd, void *buf, size_t len);