summaryrefslogtreecommitdiff
path: root/difftool/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'difftool/util.c')
-rw-r--r--difftool/util.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/difftool/util.c b/difftool/util.c
new file mode 100644
index 0000000..64ee7d4
--- /dev/null
+++ b/difftool/util.c
@@ -0,0 +1,26 @@
+/* SPDX-License-Identifier: GPL-3.0-or-later */
+/*
+ * util.c
+ *
+ * Copyright (C) 2019 David Oberhollenzer <goliath@infraroot.at>
+ */
+#include "difftool.h"
+
+char *node_path(tree_node_t *n)
+{
+ char *path = fstree_get_path(n);
+
+ if (path == NULL) {
+ perror("get path");
+ return NULL;
+ }
+
+ if (canonicalize_name(path)) {
+ fputs("[BUG] canonicalization of fstree_get_path failed!!\n",
+ stderr);
+ free(path);
+ return NULL;
+ }
+
+ return path;
+}