From aca70cd3c3fe787e62c618849e43f67b3870ac20 Mon Sep 17 00:00:00 2001 From: Michael Tokarev Date: Sun, 24 Oct 2010 15:23:10 +0400 Subject: [PATCH] Treat netname="." in a special way. Treat netname "." in a special way as if there was no netname specified. Before, f.e. tincd -n. -k didn't work as it tried to open /var/run/tinc-.pid. Now -n. works as if there was no -n option is specified. Signed-Off-By: Michael Tokarev --- src/tincd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tincd.c b/src/tincd.c index a618e63f..3dab9a01 100644 --- a/src/tincd.c +++ b/src/tincd.c @@ -221,7 +221,9 @@ static bool parse_options(int argc, char **argv) { break; case 'n': /* net name given */ - netname = xstrdup(optarg); + /* netname "." is special: a "top-level name" */ + netname = strcmp(optarg, ".") != 0 ? + xstrdup(optarg) : NULL; break; case 'o': /* option */ -- 2.20.1