Skip to content
Snippets Groups Projects
Commit 6e516aed authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Use name as default address when creating new TCP dialing entry

I usually use the hostname for the name of the dialing entry and got tired
of always having to type the hostname twice when creating a new entry.

If the name looks like a hostname or IP address (includes a dot but
no spaces) and the connection type is appropriate, make the name the
default string for the address (easily over-ridden if wrong, by just
typing the correct address). This time-saving feature doesn't work for
single-word hostnames (e.g. "localhost") or IPv6 addresses.
parent 1b5438f6
No related branches found
No related tags found
1 merge request!455Update branch with changes from master
Pipeline #6406 passed
......@@ -2963,6 +2963,10 @@ show_bbslist(char *current, int connected)
!= CONN_TYPE_SERIAL_NORTS)
&& (list[listcount - 1]->conn_type
!= CONN_TYPE_SHELL)) {
/* Default address to name, if appears to be address */
if (strchr(list[listcount - 1]->name, ' ') == NULL
&& strchr(list[listcount - 1]->name, '.') != NULL)
SAFECOPY(list[listcount - 1]->addr, list[listcount - 1]->name);
/* Set the port too */
j = conn_ports[list[listcount - 1]->conn_type];
if ((j < 1) || (j > 65535))
......@@ -2979,7 +2983,7 @@ show_bbslist(char *current, int connected)
if (uifc.changes) {
uifc.changes = 0;
uifc.helpbuf = address_help;
uifc.input(WIN_MID | WIN_SAV,
if (uifc.input(WIN_MID | WIN_SAV,
0,
0
,
......@@ -2994,7 +2998,8 @@ show_bbslist(char *current, int connected)
,
list[listcount - 1]->addr,
LIST_ADDR_MAX,
K_EDIT);
K_EDIT) >= 1)
uifc.changes = 1;
// Parse TCP port from address, if specified
switch(list[listcount -1]->conn_type) {
case CONN_TYPE_MODEM:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment