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 <mjt@tls.msk.ru>
This commit is contained in:
parent
5f729f76f5
commit
aca70cd3c3
1 changed files with 3 additions and 1 deletions
|
|
@ -221,7 +221,9 @@ static bool parse_options(int argc, char **argv) {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'n': /* net name given */
|
case 'n': /* net name given */
|
||||||
netname = xstrdup(optarg);
|
/* netname "." is special: a "top-level name" */
|
||||||
|
netname = strcmp(optarg, ".") != 0 ?
|
||||||
|
xstrdup(optarg) : NULL;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'o': /* option */
|
case 'o': /* option */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue