diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2023-02-10 15:27:06 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2023-02-10 15:27:06 +0100 |
commit | 7501bff8432444b7ae8e7f3d9289c0d61f3f0b64 (patch) | |
tree | bd53603f464c3747e897a8996158a0fef7b41bc3 /src/tc-realpath.c | |
parent | 0f124df68d87c9073f76efeff1a901a69b1f3e13 (diff) | |
parent | 9e9336185f86bd97ff22f54e4d561c2cccccecf5 (diff) |
Merge branch 'release/debian/4.10-1'debian/4.10-1
Diffstat (limited to 'src/tc-realpath.c')
-rw-r--r-- | src/tc-realpath.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/tc-realpath.c b/src/tc-realpath.c index 5dd9aa2..23609ca 100644 --- a/src/tc-realpath.c +++ b/src/tc-realpath.c @@ -1,16 +1,13 @@ +// SPDX-License-Identifier: MIT /* * Test utility for libHX's realpath - * Copyright Jan Engelhardt - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the WTF Public License version 2 or - * (at your option) any later version. */ #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <libHX/io.h> #include <libHX/option.h> +#include <libHX/string.h> static unsigned int rp_flags; static unsigned int rp_absolute; @@ -42,6 +39,14 @@ static bool rp_get_options(int *argc, const char ***argv) return true; } +static void t_1(void) +{ + hxmc_t *tmp = HXmc_strinit(""); + /* two components, so that HX_readlink gets called twice */ + HX_realpath(&tmp, "/dev/tty", HX_REALPATH_DEFAULT); + HXmc_free(tmp); +} + int main(int argc, const char **argv) { hxmc_t *res; @@ -49,6 +54,7 @@ int main(int argc, const char **argv) if (!rp_get_options(&argc, &argv)) return EXIT_FAILURE; + t_1(); res = NULL; while (--argc > 0) { |