summaryrefslogtreecommitdiff
path: root/lib/canonicalize.c
diff options
context:
space:
mode:
authorKarel Zak <kzak@redhat.com>2010-10-22 23:38:07 +0200
committerKarel Zak <kzak@redhat.com>2010-10-25 11:00:15 +0200
commit6cfa971e1b33f596bb917f1867972424f745879c (patch)
tree199faaaa0893a6a6405aaf0a4499713be0229451 /lib/canonicalize.c
parent88dd06b87554141185f3dbf31f2f18bf6c821ce3 (diff)
downloadutil-linux-old-6cfa971e1b33f596bb917f1867972424f745879c.tar.gz
lib: add test program to canonicalize.c
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'lib/canonicalize.c')
-rw-r--r--lib/canonicalize.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/canonicalize.c b/lib/canonicalize.c
index 29b3f259..1449851f 100644
--- a/lib/canonicalize.c
+++ b/lib/canonicalize.c
@@ -189,3 +189,17 @@ canonicalize_path(const char *path)
}
+#ifdef TEST_PROGRAM
+int main(int argc, char **argv)
+{
+ if (argc < 2) {
+ fprintf(stderr, "usage: %s <device>\n", argv[0]);
+ exit(EXIT_FAILURE);
+ }
+
+ fprintf(stdout, "orig: %s\n", argv[1]);
+ fprintf(stdout, "real: %s\n", canonicalize_path(argv[1]));
+
+ exit(EXIT_SUCCESS);
+}
+#endif