rv = Permission_AddHost(host.ToNewCString(), permission, type, PR_FALSE);
rv = Permission_AddHost(ToNewCString(host), permission, type, PR_FALSE);
PERMISSION_Read() {  if (permission_list) {    return NS_OK;  }  // create permission list to avoid continually attempting to re-read  // cookperm.txt if it doesn't exist  permission_list = new nsVoidArray();  if(!permission_list) {    return NS_ERROR_OUT_OF_MEMORY;  }  nsAutoString buffer;  nsFileSpec dirSpec;  nsresult rv = CKutil_ProfileDirectory(dirSpec);  if (NS_FAILED(rv)) {    return rv;  }  nsInputFileStream strm(dirSpec + kCookiesPermFileName);  if (!strm.is_open()) {    /* file doesn't exist -- that's not an error */    for (PRInt32 type=0; type<NUMBER_OF_PERMISSIONS; type++) {      permission_SetRememberChecked(type, PR_FALSE);    }    return NS_OK;  }  /* format is:   * host \t number permission \t number permission ... \n   * if this format isn't respected we move onto the next line in the file.   */  while(CKutil_GetLine(strm,buffer) != -1) {    if ( !buffer.IsEmpty() ) {      PRUnichar firstChar = buffer.CharAt(0);      if (firstChar == '#' || firstChar == nsCRT::CR ||          firstChar == nsCRT::LF || firstChar == 0) {        continue;      }    }    int hostIndex, permissionIndex;    PRUint32 nextPermissionIndex = 0;    hostIndex = 0;    if ((permissionIndex=buffer.FindChar('\t', PR_FALSE, hostIndex)+1) == 0) {      continue;          }    /* ignore leading periods in host name */    while (hostIndex < permissionIndex && (buffer.CharAt(hostIndex) == '.')) {      hostIndex++;    }    nsAutoString host;    buffer.Mid(host, hostIndex, permissionIndex-hostIndex-1);    nsAutoString permissionString;    for (;;) {      if (nextPermissionIndex == buffer.Length()+1) {        break;      }      if ((nextPermissionIndex=buffer.FindChar('\t', PR_FALSE, permissionIndex)+1) == 0) {        nextPermissionIndex = buffer.Length()+1;      }      buffer.Mid(permissionString, permissionIndex, nextPermissionIndex-permissionIndex-1);      permissionIndex = nextPermissionIndex;      PRInt32 type = 0;      PRUint32 index = 0;      if (permissionString.IsEmpty()) {        continue; /* empty permission entry -- should never happen */      }      char c = (char)permissionString.CharAt(index);      while (index < permissionString.Length() && c >= '0' && c <= '9') {        type = 10*type + (c-'0');        c = (char)permissionString.CharAt(++index);      }      if (index >= permissionString.Length()) {        continue; /* bad format for this permission entry */      }      PRBool permission = (permissionString.CharAt(index) == 'T');      /*       * a host value of "@@@@" is a special code designating the       * state of the nag-box's checkmark       */      if (host.EqualsWithConversion("@@@@")) {        if (!permissionString.IsEmpty()) {          permission_SetRememberChecked(type, permission);        }      } else {        if (!permissionString.IsEmpty()) {          rv = Permission_AddHost(host.ToNewCString(), permission, type, PR_FALSE);          if (NS_FAILED(rv)) {            strm.close();            return rv;          }        }      }    }  }  strm.close();  permission_changed = PR_FALSE;  return NS_OK;}