}  if (filename == schemaValueFileName && wallet_oldFormat) {  schemaValueFileName[10] = '\0'; SI_SetCharPref(pref_WalletSchemaValueFileName, schemaValueFileName); wallet_oldFormat = PR_FALSE;
wallet_WriteToFile(const char * filename, nsVoidArray* list, PRBool obscure) {  wallet_MapElement * ptr;  if (obscure && !Wallet_IsKeySet()) {    return;  }  /* open output stream */  nsFileSpec dirSpec;  nsresult rv = Wallet_ProfileDirectory(dirSpec);  if (NS_FAILED(rv)) {    return;  }  if (filename == schemaValueFileName && wallet_oldFormat) {    /* change name of schemaValueFileName file from "xxxxxxxx.wlt" to "xxxxxxxx.w" */        schemaValueFileName[10] = '\0';    SI_SetCharPref(pref_WalletSchemaValueFileName, schemaValueFileName);    wallet_oldFormat = PR_FALSE;  }  nsOutputFileStream strm(dirSpec + filename);  if (!strm.is_open()) {    NS_ERROR("unable to open file");    return;  }  /* make sure the list exists */  if(!list) {    return;  }  nsKeyType writeCount = 0;  /* put out the header */  if (filename == schemaValueFileName) {    saveCountW += 16; /* preserve low order four bits which designate the file type */    wallet_PutHeader(strm, saveCountW, writeCount);  }  /* traverse the list */  PRInt32 count = LIST_COUNT(list);  for (PRInt32 i=0; i<count; i++) {    ptr = NS_STATIC_CAST(wallet_MapElement*, list->ElementAt(i));    wallet_PutLine(strm, (*ptr).item1, obscure, saveCountW, &writeCount);    if ((*ptr).item2 != "") {      wallet_PutLine(strm, (*ptr).item2, obscure, saveCountW, &writeCount);    } else {      wallet_Sublist * ptr1;      PRInt32 count2 = LIST_COUNT(ptr->itemList);      for (PRInt32 j=0; j<count2; j++) {        ptr1 = NS_STATIC_CAST(wallet_Sublist*, ptr->itemList->ElementAt(j));        wallet_PutLine(strm, (*ptr1).item, obscure, saveCountW, &writeCount);      }    }    wallet_PutLine(strm, "", obscure, saveCountW, &writeCount);  }  /* close the stream */  strm.flush();  strm.close();}