diff --git a/release/sysinstall/tcpip.c b/release/sysinstall/tcpip.c index d8e5f55c476f..06d908b30c71 100644 --- a/release/sysinstall/tcpip.c +++ b/release/sysinstall/tcpip.c @@ -1,5 +1,5 @@ /* - * $Id: tcpip.c,v 1.76 1999/05/06 11:03:18 jkh Exp $ + * $Id: tcpip.c,v 1.77 1999/05/06 11:05:19 jkh Exp $ * * Copyright (c) 1995 * Gary J Palmer. All rights reserved. @@ -151,7 +151,7 @@ tcpOpenDialog(Device *devp) { WINDOW *ds_win, *save = NULL; ComposeObj *obj = NULL; - int n = 0, cancel = FALSE; + int n = 0, filled = 0, cancel = FALSE; int max, ret = DITEM_SUCCESS; char *tmp; char title[80]; @@ -263,24 +263,27 @@ tcpOpenDialog(Device *devp) reenter: cancelbutton = okbutton = 0; while (layoutDialogLoop(ds_win, layout, &obj, &n, max, &cancelbutton, &cancel)) { - /* Insert a default value for the netmask, 0xffffff00 is - the most appropriate one (entire class C, or subnetted - class A/B network). */ - if (netmask[0] == '\0') { - strcpy(netmask, "255.255.255.0"); - RefreshStringObj(layout[LAYOUT_NETMASK].obj); - } - if (!index(hostname, '.') && domainname[0]) { - strcat(hostname, "."); - strcat(hostname, domainname); - RefreshStringObj(layout[LAYOUT_HOSTNAME].obj); - } - else if (((tmp = index(hostname, '.')) != NULL) && !domainname[0]) { - SAFE_STRCPY(domainname, tmp + 1); - RefreshStringObj(layout[LAYOUT_DOMAINNAME].obj); + /* Prevent this from being irritating if user really means NO */ + if (!filled) { + filled = 1; + /* Insert a default value for the netmask, 0xffffff00 is + the most appropriate one (entire class C, or subnetted + class A/B network). */ + if (netmask[0] == '\0') { + strcpy(netmask, "255.255.255.0"); + RefreshStringObj(layout[LAYOUT_NETMASK].obj); + } + if (!index(hostname, '.') && domainname[0]) { + strcat(hostname, "."); + strcat(hostname, domainname); + RefreshStringObj(layout[LAYOUT_HOSTNAME].obj); + } + else if (((tmp = index(hostname, '.')) != NULL) && !domainname[0]) { + SAFE_STRCPY(domainname, tmp + 1); + RefreshStringObj(layout[LAYOUT_DOMAINNAME].obj); + } } } - if (!cancel && !verifySettings()) goto reenter; diff --git a/usr.sbin/sysinstall/tcpip.c b/usr.sbin/sysinstall/tcpip.c index d8e5f55c476f..06d908b30c71 100644 --- a/usr.sbin/sysinstall/tcpip.c +++ b/usr.sbin/sysinstall/tcpip.c @@ -1,5 +1,5 @@ /* - * $Id: tcpip.c,v 1.76 1999/05/06 11:03:18 jkh Exp $ + * $Id: tcpip.c,v 1.77 1999/05/06 11:05:19 jkh Exp $ * * Copyright (c) 1995 * Gary J Palmer. All rights reserved. @@ -151,7 +151,7 @@ tcpOpenDialog(Device *devp) { WINDOW *ds_win, *save = NULL; ComposeObj *obj = NULL; - int n = 0, cancel = FALSE; + int n = 0, filled = 0, cancel = FALSE; int max, ret = DITEM_SUCCESS; char *tmp; char title[80]; @@ -263,24 +263,27 @@ tcpOpenDialog(Device *devp) reenter: cancelbutton = okbutton = 0; while (layoutDialogLoop(ds_win, layout, &obj, &n, max, &cancelbutton, &cancel)) { - /* Insert a default value for the netmask, 0xffffff00 is - the most appropriate one (entire class C, or subnetted - class A/B network). */ - if (netmask[0] == '\0') { - strcpy(netmask, "255.255.255.0"); - RefreshStringObj(layout[LAYOUT_NETMASK].obj); - } - if (!index(hostname, '.') && domainname[0]) { - strcat(hostname, "."); - strcat(hostname, domainname); - RefreshStringObj(layout[LAYOUT_HOSTNAME].obj); - } - else if (((tmp = index(hostname, '.')) != NULL) && !domainname[0]) { - SAFE_STRCPY(domainname, tmp + 1); - RefreshStringObj(layout[LAYOUT_DOMAINNAME].obj); + /* Prevent this from being irritating if user really means NO */ + if (!filled) { + filled = 1; + /* Insert a default value for the netmask, 0xffffff00 is + the most appropriate one (entire class C, or subnetted + class A/B network). */ + if (netmask[0] == '\0') { + strcpy(netmask, "255.255.255.0"); + RefreshStringObj(layout[LAYOUT_NETMASK].obj); + } + if (!index(hostname, '.') && domainname[0]) { + strcat(hostname, "."); + strcat(hostname, domainname); + RefreshStringObj(layout[LAYOUT_HOSTNAME].obj); + } + else if (((tmp = index(hostname, '.')) != NULL) && !domainname[0]) { + SAFE_STRCPY(domainname, tmp + 1); + RefreshStringObj(layout[LAYOUT_DOMAINNAME].obj); + } } } - if (!cancel && !verifySettings()) goto reenter;