diff options
author | jkh <jkh@FreeBSD.org> | 1999-05-07 05:15:17 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1999-05-07 05:15:17 +0000 |
commit | 21fcf522a84c0ead65c3d49490fea55c1c8827e4 (patch) | |
tree | 6310ab9d591009528b1f24412ca0ba7174b18e59 /release/sysinstall | |
parent | b22fad8e6426e57a55ab4d42dffbbd3daa82df6f (diff) | |
download | FreeBSD-src-21fcf522a84c0ead65c3d49490fea55c1c8827e4.zip FreeBSD-src-21fcf522a84c0ead65c3d49490fea55c1c8827e4.tar.gz |
Commit a more general version of the last patch; don't do any back-filling
of values more than once. User might want to override them.
Diffstat (limited to 'release/sysinstall')
-rw-r--r-- | release/sysinstall/tcpip.c | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/release/sysinstall/tcpip.c b/release/sysinstall/tcpip.c index d8e5f55..06d908b 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; |