From 6cfa971e1b33f596bb917f1867972424f745879c Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Fri, 22 Oct 2010 23:38:07 +0200 Subject: lib: add test program to canonicalize.c Signed-off-by: Karel Zak --- lib/canonicalize.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lib/canonicalize.c') 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 \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 -- cgit v1.2.3