if (rv && !PL_strncasecmp(fileName, (const char *)regvalue, PR_MIN(len, strlen(fileName)))) {
nsCAutoString regvalueholder; regvalueholder.Assign((char *) regvalue); if ((regvalueholder.Find(fileName, PR_TRUE) != kNotFound) && (regvalueholder.Find("-turbo", PR_TRUE) != kNotFound) ) {
nsNativeAppSupportWin::CheckConsole() {    for ( int i = 1; i < __argc; i++ ) {        if ( strcmp( "-console", __argv[i] ) == 0             ||             strcmp( "/console", __argv[i] ) == 0 ) {            // Users wants to make sure we have a console.            // Try to allocate one.            BOOL rc = ::AllocConsole();            if ( rc ) {                // Console allocated.  Fix it up so that output works in                // all cases.  See http://support.microsoft.com/support/kb/articles/q105/3/05.asp.                // stdout                int hCrt = ::_open_osfhandle( (long)GetStdHandle( STD_OUTPUT_HANDLE ),                                            _O_TEXT );                if ( hCrt != -1 ) {                    FILE *hf = ::_fdopen( hCrt, "w" );                    if ( hf ) {                        *stdout = *hf;                        ::fprintf( stdout, "stdout directed to dynamic console\n" );                    }                }                // stderr                hCrt = ::_open_osfhandle( (long)::GetStdHandle( STD_ERROR_HANDLE ),                                          _O_TEXT );                if ( hCrt != -1 ) {                    FILE *hf = ::_fdopen( hCrt, "w" );                    if ( hf ) {                        *stderr = *hf;                        ::fprintf( stderr, "stderr directed to dynamic console\n" );                    }                }                // stdin?                /* Don't bother for now.                hCrt = ::_open_osfhandle( (long)::GetStdHandle( STD_INPUT_HANDLE ),                                          _O_TEXT );                if ( hCrt != -1 ) {                    FILE *hf = ::_fdopen( hCrt, "r" );                    if ( hf ) {                        *stdin = *hf;                    }                }                */            } else {                // Failed.  Probably because there already is one.                // There's little we can do, in any case.            }            // Don't bother doing this more than once.            break;        } else if ( strcmp( "-turbo", __argv[i] ) == 0                    ||                    strcmp( "/turbo", __argv[i] ) == 0                    ||                    strcmp( "-server", __argv[i] ) == 0                    ||                    strcmp( "/server", __argv[i] ) == 0 ) {            // Start in server mode (and suppress splash screen).            mServerMode = PR_TRUE;            mShouldShowUI = PR_FALSE;            __argv[i] = "-nosplash"; // Bit of a hack, but it works!            // Ignore other args.            break;        }    }    // check if this is a restart of the browser after quiting from    // the servermoded browser instance.    if (!mServerMode ) {        HKEY key;        LONG result = ::RegOpenKeyEx( HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Run", 0, KEY_QUERY_VALUE, &key );        if ( result == ERROR_SUCCESS ) {          BYTE regvalue[_MAX_PATH];          DWORD type, len = sizeof(regvalue);          result = ::RegQueryValueEx( key, NS_QUICKLAUNCH_RUN_KEY, NULL, &type, regvalue, &len);          ::RegCloseKey( key );          if ( result == ERROR_SUCCESS && len > 0 ) {              // Make sure the filename in the quicklaunch command matches us              char fileName[_MAX_PATH];              int rv = ::GetModuleFileName( NULL, fileName, sizeof fileName );              if (rv && !PL_strncasecmp(fileName, (const char *)regvalue, PR_MIN(len, strlen(fileName)))) {                  mServerMode = PR_TRUE;                  mShouldShowUI = PR_TRUE;              }          }        }    }    return;}