]> git.saurik.com Git - wxWidgets.git/commitdiff
applied SF patch # 826838 to fix removal of -psn_* command line argument
authorGilles Depeyrot <gilles_depeyrot@mac.com>
Tue, 21 Oct 2003 20:22:34 +0000 (20:22 +0000)
committerGilles Depeyrot <gilles_depeyrot@mac.com>
Tue, 21 Oct 2003 20:22:34 +0000 (20:22 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24240 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/cocoa/app.mm
src/mac/app.cpp
src/mac/carbon/app.cpp

index 6a2c443ac43f04068e1ec0fda2f59e1c9210a57a..6222f501b5271656f9812eb26fced2153e3f9f0b 100644 (file)
@@ -174,10 +174,11 @@ bool wxApp::Initialize(int& argc, wxChar **argv)
     if ( argc > 1 )
     {
         static const wxChar *ARG_PSN = _T("-psn_");
-        if ( wxStrncmp(argv[1], ARG_PSN, sizeof(ARG_PSN) - 1) == 0 )
+        if ( wxStrncmp(argv[1], ARG_PSN, strlen(ARG_PSN)) == 0 )
         {
             // remove this argument
-            memmove(argv, argv + 1, argc--);
+            --argc;
+            memmove(argv + 1, argv + 2, argc * sizeof(char *));
         }
     }
 
index a8ca3cdb669a24720efbe41514235b953acb7a9d..57a0a7a787306777b776d8a358c18da6c91d9af9 100644 (file)
@@ -609,10 +609,11 @@ bool wxApp::Initialize(int& argc, wxChar **argv)
     if ( argc > 1 )
     {
         static const wxChar *ARG_PSN = _T("-psn_");
-        if ( wxStrncmp(argv[1], ARG_PSN, sizeof(ARG_PSN) - 1) == 0 )
+        if ( wxStrncmp(argv[1], ARG_PSN, strlen(ARG_PSN)) == 0 )
         {
             // remove this argument
-            memmove(argv, argv + 1, argc--);
+            --argc;
+            memmove(argv + 1, argv + 2, argc * sizeof(char *));
         }
     }
 
index a8ca3cdb669a24720efbe41514235b953acb7a9d..57a0a7a787306777b776d8a358c18da6c91d9af9 100644 (file)
@@ -609,10 +609,11 @@ bool wxApp::Initialize(int& argc, wxChar **argv)
     if ( argc > 1 )
     {
         static const wxChar *ARG_PSN = _T("-psn_");
-        if ( wxStrncmp(argv[1], ARG_PSN, sizeof(ARG_PSN) - 1) == 0 )
+        if ( wxStrncmp(argv[1], ARG_PSN, strlen(ARG_PSN)) == 0 )
         {
             // remove this argument
-            memmove(argv, argv + 1, argc--);
+            --argc;
+            memmove(argv + 1, argv + 2, argc * sizeof(char *));
         }
     }