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]

[setup PATCH] Another micropatch heading towards next_dialog removal (1)


Index: ChangeLog
===================================================================
RCS file: /home/max/cvsmirror/cygwin-apps-cvs/setup/ChangeLog,v
retrieving revision 2.373
diff -u -p -r2.373 ChangeLog
--- ChangeLog 26 Jul 2003 09:01:35 -0000 2.373
+++ ChangeLog 26 Jul 2003 10:06:57 -0000
@@ -0,0 +1,6 @@
+2003-07-26  Max Bowsher  <maxb@ukf.net>
+
+ * 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 the
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.


Max.


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