if (filename == schemaValueFileName && !wallet_oldFormat) {
if (filename == schemaValueFileName) {
wallet_ReadFromFile    (const char * filename, nsVoidArray*& list, PRBool obscure, PRBool localFile, PlacementType placement = DUP_AFTER) {  /* open input stream */  nsFileSpec dirSpec;  nsresult rv;  rv = Wallet_ProfileDirectory(dirSpec);  if (NS_FAILED(rv) && localFile) {    /* if we failed to download the file, see if an initial version of it exists */    rv = Wallet_ResourceDirectory(dirSpec);  }  if (NS_FAILED(rv)) {    return;  }  nsInputFileStream strm(dirSpec + filename);  if (!strm.is_open()) {    /* file doesn't exist -- that's not an error */    return;  }  nsKeyType readCount = 0;  /* read in the header */  if (filename == schemaValueFileName && !wallet_oldFormat) {    wallet_GetHeader(strm, saveCountW, readCount);  }  for (;;) {    nsAutoString item1;    if (NS_FAILED(wallet_GetLine(strm, item1, obscure, saveCountW, &readCount))) {      /* end of file reached */      break;    }#ifdef AutoCapture    /* Distinguished schema list is a list of single entries, not name/value pairs */    if (PL_strcmp(filename, distinguishedSchemaFileName) == 0) {      nsVoidArray* dummy = NULL;      wallet_WriteToList(item1, item1, dummy, list, placement);      continue;    }#endif    nsAutoString item2;    if (NS_FAILED(wallet_GetLine(strm, item2, obscure, saveCountW, &readCount))) {      /* unexpected end of file reached */      break;    }    nsAutoString item3;    if (NS_FAILED(wallet_GetLine(strm, item3, obscure, saveCountW, &readCount))) {      /* end of file reached */      nsVoidArray* dummy = NULL;      wallet_WriteToList(item1, item2, dummy, list, placement);      strm.close();      return;    }    if (item3.Length()==0) {      /* just a pair of values, no need for a sublist */      nsVoidArray* dummy = NULL;      wallet_WriteToList(item1, item2, dummy, list, placement);    } else {      /* need to create a sublist and put item2 and item3 onto it */      nsVoidArray * itemList = new nsVoidArray();      if (!itemList) {        break;      }      wallet_Sublist * sublist = new wallet_Sublist;      if (!sublist) {        break;      }      sublist->item = item2;      itemList->AppendElement(sublist);      sublist = new wallet_Sublist;      if (!sublist) {        break;      }      sublist->item = item3;      itemList->AppendElement(sublist);      /* add any following items to sublist up to next blank line */      nsAutoString dummy2;      for (;;) {        /* get next item for sublist */        item3 = "";        if (NS_FAILED(wallet_GetLine(strm, item3, obscure, saveCountW, &readCount))) {          /* end of file reached */          wallet_WriteToList(item1, dummy2, itemList, list, placement);          strm.close();          return;        }        if (item3.Length()==0) {          /* blank line reached indicating end of sublist */          wallet_WriteToList(item1, dummy2, itemList, list, placement);          break;        }        /* add item to sublist */        sublist = new wallet_Sublist;        if (!sublist) {          break;        }        sublist->item = nsAutoString (item3);        itemList->AppendElement(sublist);      }    }  }  strm.close();}