Changeset 1174 for trunk/dll


Ignore:
Timestamp:
Sep 8, 2008, 7:27:38 PM (17 years ago)
Author:
Steven Levine
Message:

Remove extra pszLongName logic in FreeCnrItemData

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/filldir.c

    r1159 r1174  
    4949  01 Sep 08 GKY Updated FreeCnrItemData to prevent trap in strrchr if pci->pszFileName is NULL.
    5050  05 Sep 08 SHL Correct FreeCnrItemData pszDisplayName pointer overlap check
     51  08 Sep 08 SHL Remove extra pszLongName logic in FreeCnrItemData
    5152
    5253***********************************************************************/
     
    617618          pfea = &eaop.fpFEA2List->list[0];
    618619          value = pfea->szName + pfea->cbName + 1;      // Point at EA value
    619           value[pfea->cbValue] = 0;                     // Terminate
     620          value[pfea->cbValue] = 0;     // Terminate
    620621          if (*(USHORT *) value == EAT_ASCII) {
    621             p = value + sizeof(USHORT) * 2;             // Point at value string
     622            p = value + sizeof(USHORT) * 2;     // Point at value string
    622623            pci->pszLongName = xstrdup(p, pszSrcFile, __LINE__);
    623624          }
     
    790791  if (isalpha(*szDirBase) && szDirBase[1] == ':' && szDirBase[2] == '\\') {
    791792    if ((driveflags[toupper(*szDirBase) - 'A'] & DRIVE_REMOTE) && fRemoteBug)
    792       ulFindMax = 1;                            // file system gets confused
     793      ulFindMax = 1;                    // file system gets confused
    793794    else if (driveflags[toupper(*szDirBase) - 'A'] & DRIVE_ZIPSTREAM)
    794795      ulFindMax = min(FilesToGet, 225); // anything more is wasted
     
    16331634  if (pci->pszSubject && pci->pszSubject != NullStr) {
    16341635    psz = pci->pszSubject;
    1635     //pci->pszSubject = NullStr;
    1636     pci->pszSubject = NULL;             // for debug
     1636    pci->pszSubject = NULL;             // Catch illegal references
    16371637    free(psz);
    16381638  }
    16391639
    1640   // +1 in case long name pointing after last backslash
    1641   if (pci->pszLongName &&
    1642       pci->pszLongName != NullStr &&
    1643       pci->pszLongName != pci->pszFileName &&
    1644       pci->pszLongName != pci->pszDisplayName &&
    1645       pci->pszLongName != pci->pszDisplayName + 1) {
     1640  // 08 Sep 08 SHL Remove excess logic
     1641  if (pci->pszLongName && pci->pszLongName != NullStr) {
    16461642    psz = pci->pszLongName;
    1647     //pci->pszLongName = NullStr;
    1648     pci->pszLongName = NULL;            // for debug
     1643    pci->pszLongName = NULL;            // Catch illegal references
    16491644    free(psz);
    16501645  }
    1651 
    1652   // Check double free
    1653   if (!pci->pszFileName)
    1654     DbgMsg(pszSrcFile, __LINE__, "FreeCnrItemData pci->pszFileName already NULL");
    16551646
    16561647  // Bypass free if pszDisplayName points into pszFileName buffer
     
    16641655    {
    16651656      psz = pci->pszDisplayName;
    1666       // pci->pszDisplayName = NullStr;
    1667       pci->pszDisplayName = NULL;               // for debug
     1657      pci->pszDisplayName = NULL;       // Catch illegal references
    16681658      free(psz);
    16691659    }
    16701660  }
     1661
     1662  // Catch extra calls to FreeCnrItemData
     1663  if (!pci->pszFileName)
     1664    DbgMsg(pszSrcFile, __LINE__, "FreeCnrItemData pci->pszFileName already NULL");
    16711665
    16721666  if (pci->pszFileName && pci->pszFileName != NullStr) {
    16731667    psz = pci->pszFileName;
    1674     //pci->pszFileName = NullStr;
    1675     pci->pszFileName = NULL;            // for debug
     1668    pci->pszFileName = NULL;            // Catch illegal references
    16761669    free(psz);
    16771670  }
     
    16791672  if (pci->pszFmtFileSize && pci->pszFmtFileSize != NullStr) {
    16801673    psz = pci->pszFmtFileSize;
    1681     //pci->pszFmtFileSize = NullStr;
    1682     pci->pszFmtFileSize = NULL;         // for debug
     1674    pci->pszFmtFileSize = NULL;         // Catch illegal references
    16831675    free(psz);
    16841676  }
     
    17601752      while (pci) {
    17611753        // 12 Sep 07 SHL dwg drivebar crash testing - ticket# ???
    1762         static PCNRITEM pciLast;                // 12 Sep 07 SHL
     1754        static PCNRITEM pciLast;        // 12 Sep 07 SHL
    17631755        ULONG ulSize = sizeof(*pci);
    17641756        ULONG ulAttr;
Note: See TracChangeset for help on using the changeset viewer.