if(curHostColon) { *curHostColon = ':'; } if(firstHostColon) { *firstHostColon = ':'; }
cookie_isForeign (nsIURI * curURL, nsIURI * firstURL) {  if (!firstURL) {    return PR_FALSE;  }  PRBool isChrome = PR_FALSE;  nsresult rv = firstURL->SchemeIs("chrome", &isChrome);  if (NS_SUCCEEDED(rv) && isChrome) {     return PR_FALSE; // chrome URLs are never foreign (otherwise sidebar cookies won't work)  }  nsCAutoString curHost, firstHost;  // Get hosts  rv = curURL->GetHostPort(curHost);  if (NS_FAILED(rv)) {    return PR_FALSE;  }  rv = firstURL->GetHostPort(firstHost);  if (NS_FAILED(rv)) {    return PR_FALSE;  }  char * curHostColon = 0;  char * firstHostColon = 0;  /* strip ports */  curHostColon = (char *)strchr(curHost.get(), ':');  if(curHostColon) {    *curHostColon = '\0';  }  firstHostColon = (char *)strchr(firstHost.get(), ':');  if(firstHostColon) {    *firstHostColon = '\0';  }  /* determine if it's foreign */  PRBool retval = (!cookie_SameDomain((char*)curHost.get(), (char*)firstHost.get()));  /* clean up our garbage and return */  if(curHostColon) {    *curHostColon = ':';  }  if(firstHostColon) {    *firstHostColon = ':';  }  return retval;}