From 89adc0e26d9020cfbe23fd4b0eec5ff33055a694 Mon Sep 17 00:00:00 2001 From: simon Date: Sat, 5 Mar 2005 15:05:18 +0000 Subject: [PATCH] Platform-independent fixes for NO_IPV6 compilation (prevent segfaults on trying to access pfd->addressfamily which doesn't exist). git-svn-id: svn://svn.tartarus.org/sgt/putty@5444 cda61777-01e9-0310-a592-d414129be87e --- config.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/config.c b/config.c index 60724cef..5b44c01f 100644 --- a/config.c +++ b/config.c @@ -666,7 +666,9 @@ static void environ_handler(union control *ctrl, void *dlg, struct portfwd_data { union control *addbutton, *rembutton, *listbox; union control *sourcebox, *destbox, *direction; +#ifndef NO_IPV6 union control *addressfamily; +#endif }; static void portfwd_handler(union control *ctrl, void *dlg, @@ -691,8 +693,10 @@ static void portfwd_handler(union control *ctrl, void *dlg, * Default is Local. */ dlg_radiobutton_set(ctrl, dlg, 0); - } else if (ctrl == pfd->addressfamily) { +#ifndef NO_IPV6 + } else if (ctrl == pfd->addressfamily) { dlg_radiobutton_set(ctrl, dlg, 0); +#endif } } else if (event == EVENT_ACTION) { if (ctrl == pfd->addbutton) { @@ -702,11 +706,13 @@ static void portfwd_handler(union control *ctrl, void *dlg, int whichbutton; i = 0; +#ifndef NO_IPV6 whichbutton = dlg_radiobutton_get(pfd->addressfamily, dlg); if (whichbutton == 1) str[i++] = '4'; else if (whichbutton == 2) str[i++] = '6'; +#endif whichbutton = dlg_radiobutton_get(pfd->direction, dlg); if (whichbutton == 0) -- 2.11.0