]> git.pond.sub.org Git - empserver/commit
Change how client option -s interprets ':'
authorMarkus Armbruster <armbru@pond.sub.org>
Fri, 2 Apr 2010 09:51:15 +0000 (11:51 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 9 May 2010 07:08:01 +0000 (09:08 +0200)
commit464094a69306c21191c146cee572af48b7ede9e3
tree9aff6cccd4ad72f58ba9f70c9b542557d83958e1
parentf4fe7da1fbf9f0f108cd8496ed0f2f67bf4a972f
Change how client option -s interprets ':'

Old version recognizes the first ':', which prevents use of ':' in
host names.  They are used in numerical IPv6 addresses.  New version
recognizes the last ':', which prevents use of ':' in service names.

Old version treats empty host or port specially (use default).
Documentation suggests ':' is required, but the code doesn't do that.
Instead, the argument is interpreted as host, even when it's empty.

New version makes the HOST: part optional.  You can't specify host and
default the port.  Tough.  Keeps documentation and code as simple as
possible.

Compare:

                old version             new version
    argument    host    port            host    port
    ""          ""      default         default ""
    "A"         "A"     default         default "A"
    ":"         default default         ""      ""
    "A:"        "A"     default         "A"     ""
    ":B"        default "B"             ""      "B"
    "A:B"       "A"     "B"             "A"     "B"
man/empire.6
src/client/main.c