if (obscure && Wallet_BadKey()) {
if (obscure && !Wallet_KeySet()) {
wallet_WriteToFile(char* filename, XP_List* list, PRBool obscure) {  XP_List * list_ptr;  wallet_MapElement * ptr;  if (obscure && Wallet_BadKey()) {    return;  }  /* open output stream */  nsFileSpec dirSpec;  nsresult rv = Wallet_ProfileDirectory(dirSpec);  if (NS_FAILED(rv)) {    return;  }  nsOutputFileStream strm(dirSpec + filename);  if (!strm.is_open()) {    NS_ERROR("unable to open file");    return;  }  /* make sure the list exists */  if(!list) {    return;  }  Wallet_RestartKey();  /* traverse the list */  list_ptr = list;  while((ptr = (wallet_MapElement *) XP_ListNextObject(list_ptr))!=0) {    if (NS_FAILED(wallet_PutLine(strm, *ptr->item1, obscure))) {      break;    }    if (*ptr->item2 != "") {      if (NS_FAILED(wallet_PutLine(strm, *ptr->item2, obscure))) {        break;      }    } else {      XP_List * list_ptr1;      wallet_Sublist * ptr1;      list_ptr1 = ptr->itemList;      while((ptr1=(wallet_Sublist *) XP_ListNextObject(list_ptr1))!=0) {        if (NS_FAILED(wallet_PutLine(strm, *ptr->item1, obscure))) {          break;        }      }    }    if (NS_FAILED(wallet_PutLine(strm, "", obscure))) {      break;    }  }  /* close the stream */  strm.flush();  strm.close();}