This is the mail archive of the
mailing list for the Cygwin project.
Re: [setup PATCH] Another micropatch heading towards next_dialog removal (1)
- From: "Max Bowsher" <maxb at ukf dot net>
- To: <cygwin-apps at cygwin dot com>
- Date: Sun, 27 Jul 2003 19:20:27 +0100
- Subject: Re: [setup PATCH] Another micropatch heading towards next_dialog removal (1)
We seem to have consensus that this error condition cannot occur, therefore
no complex retry loop is required.
OK to commit now?
Max Bowsher wrote:
> +2003-07-26 Max Bowsher <email@example.com>
> + * dialog.h: (NEXT): Remove obsolete macro.
> + * site.cc (save_dialog): Remove use of NEXT(). Replace with an exit,
> + as this is a serious but incredibly unlikely runtime error.
> Index: dialog.h
> RCS file: /home/max/cvsmirror/cygwin-apps-cvs/setup/dialog.h,v
> retrieving revision 2.9
> diff -u -p -r2.9 dialog.h
> --- dialog.h 23 Jul 2003 22:28:30 -0000 2.9
> +++ dialog.h 26 Jul 2003 10:04:12 -0000
> @@ -40,9 +40,6 @@ D (do_postinstall);
> #undef D
> -/* end this dialog and select the next. Pass 0 to exit the program */
> -#define NEXT(id) EndDialog((HWND)h, 0), next_dialog = id
> /* Get the value of an EditText control. Pass the previously stored
> value and it will free the memory if needed. */
> Index: site.cc
> RCS file: /home/max/cvsmirror/cygwin-apps-cvs/setup/site.cc,v
> retrieving revision 2.28
> diff -u -p -r2.28 site.cc
> --- site.cc 26 Jul 2003 09:01:35 -0000 2.28
> +++ site.cc 26 Jul 2003 10:05:25 -0000
> @@ -160,7 +160,7 @@ save_dialog (HWND h)
> (LPARAM) sel_buffer);
> if (sel_count != sel_count2)
> - NEXT (IDD_SITE);
> + exit(100);
> for (int n = 0; n < sel_count; n++)
> A little background on the error case - basically, it is the case where a
> user clicks "Next", and then somehow manages to change the selection in
> listbox before the code reads it fully.
> Even if the user possesses super-speed, I'm not sure if it would be
> possible. I suspect that by the time Windows is prepared to respond to
> another click message, the window of opportunity is closed.