} if (image_GetBehaviorPref() == COOKIE_DontAcceptForeign) {   PRInt32 dotcount = 0; char * tailHostname = hostname + PL_strlen(hostname) - 1; while (tailHostname > hostname) { if (*tailHostname == '.') { dotcount++; } if (dotcount == 2) { tailHostname++; break; } tailHostname--; } dotcount = 0; char * tailFirstHostname = firstHostname + PL_strlen(firstHostname) - 1; while (tailFirstHostname > firstHostname) { if (*tailFirstHostname == '.') { dotcount++; } if (dotcount == 2) { tailFirstHostname++; break; } tailFirstHostname--; } if (PL_strcmp(tailFirstHostname, tailHostname)) { permission = PR_FALSE; return NS_OK; }
Image_CheckForPermission(char * hostname, char * firstHostname, PRBool &permission) {  /* exit if imageblocker is not enabled */  nsresult rv;  PRBool prefvalue = PR_FALSE;  NS_WITH_SERVICE(nsIPref, prefs, "component://netscape/preferences", &rv);  if (NS_FAILED(rv) ||       NS_FAILED(prefs->GetBoolPref("imageblocker.enabled", &prefvalue)) ||      !prefvalue) {    permission = PR_TRUE;    return NS_OK;  }  /* try to make a decision based on pref settings */  if ((image_GetBehaviorPref() == COOKIE_DontUse)  ||      (image_GetBehaviorPref() == COOKIE_DontAcceptForeign &&//      PL_strcmp(hostname, firstHostname))) {        !cookie_SameDomain(hostname, firstHostname))) {    permission = PR_FALSE;    return NS_OK;  }  /* use common routine to make decision */  PRUnichar * message = cookie_Localize("PermissionToAcceptImage");  PRUnichar * new_string = nsTextFormatter::smprintf(message, hostname ? hostname : "");  permission = permission_Check(hostname, IMAGEPERMISSION,                                image_GetWarningPref(), new_string);  PR_FREEIF(new_string);  Recycle(message);  return NS_OK;}