From c106a290ed07fa89b39072925b1a2258071511a8 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Fri, 20 Sep 2019 03:52:49 +0200 Subject: Large round of dead code removal Remove all the library functions that no longer have any users. Signed-off-by: David Oberhollenzer --- lib/fstree/node_from_path.c | 46 --------------------------------------------- 1 file changed, 46 deletions(-) delete mode 100644 lib/fstree/node_from_path.c (limited to 'lib/fstree/node_from_path.c') diff --git a/lib/fstree/node_from_path.c b/lib/fstree/node_from_path.c deleted file mode 100644 index 9140b2d..0000000 --- a/lib/fstree/node_from_path.c +++ /dev/null @@ -1,46 +0,0 @@ -/* SPDX-License-Identifier: GPL-3.0-or-later */ -/* - * node_from_path.c - * - * Copyright (C) 2019 David Oberhollenzer - */ -#include "config.h" - -#include "fstree.h" - -#include -#include - -tree_node_t *fstree_node_from_path(fstree_t *fs, const char *path) -{ - tree_node_t *n = fs->root; - const char *end; - size_t len; - - while (path != NULL && *path != '\0') { - if (!S_ISDIR(n->mode)) { - errno = ENOTDIR; - return NULL; - } - - end = strchrnul(path, '/'); - len = end - path; - - for (n = n->data.dir->children; n != NULL; n = n->next) { - if (strncmp(path, n->name, len) != 0) - continue; - if (n->name[len] != '\0') - continue; - break; - } - - if (n == NULL) { - errno = ENOENT; - return NULL; - } - - path = *end ? (end + 1) : end; - } - - return n; -} -- cgit v1.2.3