summaryrefslogtreecommitdiff
path: root/difftool/util.c
blob: 64ee7d4b4374c23599f31a08e6c031f16d82e6f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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;
}