This is the mail archive of the cygwin-apps@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Re: proxy setup help


Robert Collins wrote:
> On Sat, 2003-03-08 at 07:50, Max Bowsher wrote:
>
>>> Should do it.
>>
>> Except it doesn't work - the OK button is still disabled.
>
> Ah:[.
>
>> Would you like me to also remove the check on *passwd here:
>> static void
>> check_if_enable_ok (HWND h)
>> {
>>   int e = 0;
>>   if (*user && *passwd)
>
> Well, that should work untouched - my patch was intended to change
> (*password) from NULL on empty dialog box to a pointer to char[1]. My
> patch must have been faulty then...

check_if_enable_ok runs *before* the dialog is closed - i.e. the code your
patch adds never gets a chance to run.

>>     e = 1;
>>   EnableWindow (GetDlgItem (h, IDOK), e);
>> }
>>
>> or, would you prefer my invasive-but-less-kludgy patch.
>
> It's more kludgy. You're changing the behaviour of a low level tool
> in a way that produces scattered changes, rather than isolating the
> needed changes and addressing those.

I prefer to see it as fixing a low level tool, but nevermind, I accept your
point-of-view.

Patch for review:
Index: netio.cc
===================================================================
RCS file: /home/max/cvsmirror/cygwin-apps-cvs/setup/netio.cc,v
retrieving revision 2.8
diff -u -p -r2.8 netio.cc
--- netio.cc 4 May 2002 12:15:56 -0000 2.8
+++ netio.cc 7 Mar 2003 20:50:47 -0000
@@ -170,7 +170,7 @@ static void
 check_if_enable_ok (HWND h)
 {
   int e = 0;
-  if (*user && *passwd)
+  if (*user)
     e = 1;
   EnableWindow (GetDlgItem (h, IDOK), e);
 }
@@ -190,6 +190,10 @@ save_dialog (HWND h)
 {
   *user = eget (h, IDC_NET_USER, *user);
   *passwd = eget (h, IDC_NET_PASSWD, *passwd);
+  if (! *passwd) {
+    *passwd = new char[1];
+    passwd[0] = '\0';
+  }
 }

 static BOOL


Max.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]