summaryrefslogtreecommitdiff
path: root/bin/sqfsdiff/util.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-04-27 11:59:02 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-04-27 11:59:02 +0200
commit20b0d509f67dea802706cd6b80b5e20d14988931 (patch)
tree3a87ea358b1206f6823777693d109896d6908283 /bin/sqfsdiff/util.c
parent9e332a2d3eddcc262476ac263e03df021b3c44b4 (diff)
Cleanup directory structure of the binary programs
Instead of having the binary programs in randomly named subdirectories, move all of them to a "bin" subdirectory, similar to the utility libraries that have subdirectories within "lib" and give the subdirectories the propper names (e.g. have gensquashfs source in a directory *actually* named "gensquashfs"). Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'bin/sqfsdiff/util.c')
-rw-r--r--bin/sqfsdiff/util.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/bin/sqfsdiff/util.c b/bin/sqfsdiff/util.c
new file mode 100644
index 0000000..5e9161a
--- /dev/null
+++ b/bin/sqfsdiff/util.c
@@ -0,0 +1,25 @@
+/* SPDX-License-Identifier: GPL-3.0-or-later */
+/*
+ * util.c
+ *
+ * Copyright (C) 2019 David Oberhollenzer <goliath@infraroot.at>
+ */
+#include "sqfsdiff.h"
+
+char *node_path(const sqfs_tree_node_t *n)
+{
+ char *path = sqfs_tree_node_get_path(n);
+
+ if (path == NULL) {
+ perror("get path");
+ return NULL;
+ }
+
+ if (canonicalize_name(path)) {
+ fprintf(stderr, "failed to canonicalization '%s'\n", path);
+ free(path);
+ return NULL;
+ }
+
+ return path;
+}