• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

The MinGW.org Installation Manager Tool


Commit MetaInfo

Revisãoc899902968d2a6d18c03600e013db86f3f659ace (tree)
Hora2013-05-08 23:34:32
AutorKeith Marshall <keithmarshall@user...>
CommiterKeith Marshall

Mensagem de Log

Avoid unnecessary command line globbing in GUI applications.

Mudança Sumário

Diff

--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
1+2013-05-08 Keith Marshall <keithmarshall@users.sourceforge.net>
2+
3+ Avoid unnecessary command line globbing in GUI applications.
4+
5+ * src/guimain.cpp src/guistub.cpp (_CRT_glob): Declare as extern "C";
6+ initialise to zero, so overriding the runtime start-up default.
7+
8+ * src/rites.c [! IMPLEMENT_INITIATION_RITES] (_CRT_glob): Initialise
9+ to zero here too; lastrites.exe doesn't need globbing either.
10+
111 2013-05-04 Keith Marshall <keithmarshall@users.sourceforge.net>
212
313 Address some GCC-4.7 string initialisation warnings.
--- a/src/guimain.cpp
+++ b/src/guimain.cpp
@@ -4,7 +4,7 @@
44 * $Id$
55 *
66 * Written by Keith Marshall <keithmarshall@users.sourceforge.net>
7- * Copyright (C) 2012, MinGW Project
7+ * Copyright (C) 2012, 2013, MinGW.org Project
88 *
99 *
1010 * Implementation of the WinMain() function, providing the program
@@ -34,6 +34,14 @@ using WTK::WindowClassMaker;
3434 using WTK::MainWindowMaker;
3535 using WTK::runtime_error;
3636
37+/* We've no use for command line arguments here, so disable globbing;
38+ * note that this API must be declared 'extern "C"', but the compiler
39+ * will complain if we declare as such, and initialise with a single
40+ * statement, so we keep the two concepts separate.
41+ */
42+extern "C" int _CRT_glob;
43+int _CRT_glob = 0;
44+
3745 int APIENTRY WinMain
3846 ( HINSTANCE Instance, HINSTANCE PrevInstance, char *CmdLine, int ShowMode )
3947 {
--- a/src/guistub.cpp
+++ b/src/guistub.cpp
@@ -5,7 +5,7 @@
55 *
66 * Written by Keith Marshall <keithmarshall@users.sourceforge.net>
77 * Derived from stub by Sze Howe Koh <axfangli@users.sourceforge.net>
8- * Copyright (C) 2011, MinGW Project
8+ * Copyright (C) 2011, 2013, MinGW.org Project
99 *
1010 *
1111 * Implementation of the GUI main program function, which is invoked
@@ -31,6 +31,14 @@
3131 */
3232 #include <windows.h>
3333
34+/* We've no use for command line arguments here, so disable globbing;
35+ * note that this API must be declared 'extern "C"', but the compiler
36+ * will complain if we declare as such, and initialise with a single
37+ * statement, so we keep the two concepts separate.
38+ */
39+extern "C" int _CRT_glob;
40+int _CRT_glob = 0;
41+
3442 int APIENTRY WinMain
3543 ( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow )
3644 {
--- a/src/rites.c
+++ b/src/rites.c
@@ -5,7 +5,7 @@
55 * $Id$
66 *
77 * Written by Keith Marshall <keithmarshall@users.sourceforge.net>
8- * Copyright (C) 2009, 2010, 2012, MinGW.org Project
8+ * Copyright (C) 2009, 2010, 2012, 2013, MinGW.org Project
99 *
1010 *
1111 * Implementation of the main program function for the "lastrites.exe"
@@ -94,6 +94,12 @@
9494 * always report success.
9595 */
9696 # define END_RITES_IMPLEMENTATION return EXIT_SUCCESS;
97+
98+/* We may note that this free-standing "main()" function doesn't
99+ * process command line arguments, so we may disable globbing in
100+ * the system runtime start-up code.
101+ */
102+int _CRT_glob = 0;
97103 #endif
98104
99105 /* Provide selectors, to discriminate the two distinct classes