mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
only insert -calendar to the list of arguments if it isn't already in it. should prevent opening multiple windows
bug 251442, r=mostafah
This commit is contained in:
parent
e7423c3111
commit
247db105a8
@ -42,6 +42,7 @@
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#include "nsBuildID.h"
|
||||
#include <string.h>
|
||||
|
||||
const int TMP_ARG_MAX=21;
|
||||
static const nsXREAppData kAppData = {
|
||||
@ -57,15 +58,30 @@ static const nsXREAppData kAppData = {
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
char* temparg[TMP_ARG_MAX+1];
|
||||
temparg[0] = argv[0];
|
||||
temparg[1] = "-calendar";
|
||||
char **argPtr;
|
||||
int argCount;
|
||||
int i;
|
||||
for( i=1; i<argc && i<TMP_ARG_MAX-1; i++ ) {
|
||||
temparg[i+1]=argv[i];
|
||||
bool found = false;
|
||||
for (i=0; i < argc; i++) {
|
||||
if (!strncmp("-calendar", argv[i], 9))
|
||||
found = true;
|
||||
}
|
||||
//we still might lose some args. a check would be handy with big neon letters yelling at the user.
|
||||
temparg[i+1]=0;
|
||||
return xre_main(argc+1, temparg, &kAppData);
|
||||
if (!found) {
|
||||
temparg[0] = argv[0];
|
||||
temparg[1] = "-calendar";
|
||||
for( i=1; i<argc && i<TMP_ARG_MAX-1; i++ ) {
|
||||
temparg[i+1]=argv[i];
|
||||
}
|
||||
//we still might lose some args. a check would be handy with big neon letters yelling at the user.
|
||||
temparg[i+1]=0;
|
||||
argPtr = temparg;
|
||||
argCount = argc + 1;
|
||||
} else {
|
||||
argPtr = argv;
|
||||
argCount = argc;
|
||||
}
|
||||
|
||||
return xre_main(argCount, argPtr, &kAppData);
|
||||
}
|
||||
|
||||
#if defined( XP_WIN ) && defined( WIN32 ) && !defined(__GNUC__)
|
||||
|
@ -57,6 +57,9 @@ pref("app.version",
|
||||
pref("app.build_id",
|
||||
#expand __BUILD_ID__
|
||||
);
|
||||
pref("app.extensions.version",
|
||||
#expand __APP_VERSION__
|
||||
);
|
||||
|
||||
pref("update.app.enabled", false);
|
||||
pref("update.app.url", "chrome://mozapps/locale/update/update.properties");
|
||||
|
Loading…
Reference in New Issue
Block a user