Changeset 730 for trunk/dll/dirsize.c
- Timestamp:
- Jul 22, 2007, 7:57:09 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/dirsize.c
r689 r730 97 97 RECORDINSERT ri; 98 98 PCNRITEM pCI; 99 CHAR *f = 0; 99 100 100 101 // fixme to report errors … … 146 147 else 147 148 DosError(FERR_DISABLEHARDERR); 148 pCI->pszLongname = pCI-> szFileName;149 pCI->pszLongname = pCI->pszFileName; 149 150 pCI->rc.hptrIcon = hptrDir; 150 *pCI->szDispAttr = *pCI->szLongname = *pCI->szSubject = 0; 151 pCI->attrFile = 0L; 151 *pCI->szDispAttr = 0; 152 pCI->attrFile = 0; 153 pCI->pszLongname = xstrdup(f, pszSrcFile, __LINE__); 154 pCI->pszSubject = xstrdup(f, pszSrcFile, __LINE__); 152 155 } 153 156 else { … … 162 165 163 166 if (strlen(pszFileName) < 4 || top) 164 strcpy(pCI->szFileName, pszFileName);167 pCI->pszFileName = xstrdup(pszFileName, pszSrcFile, __LINE__); 165 168 else { 166 169 p = strrchr(pszFileName, '\\'); … … 170 173 p++; 171 174 sp = (strchr(pszFileName, ' ') != NULL) ? "\"" : NullStr; 172 pp = pCI-> szFileName;175 pp = pCI->pszFileName; 173 176 if (*sp) { 174 177 *pp = *sp; … … 180 183 strcat(pp, sp); 181 184 } 182 pCI->pszFileName = pCI-> szFileName + strlen(pCI->szFileName);185 pCI->pszFileName = pCI->pszFileName + strlen(pCI->pszFileName); 183 186 pCI->rc.pszIcon = pCI->pszLongname; 184 187 pCI->rc.flRecordAttr |= CRA_RECORDREADONLY; 185 188 if (fForceUpper) 186 strupr(pCI-> szFileName);189 strupr(pCI->pszFileName); 187 190 else if (fForceLower) 188 strlwr(pCI-> szFileName);191 strlwr(pCI->pszFileName); 189 192 memset(&ri, 0, sizeof(RECORDINSERT)); 190 193 ri.cb = sizeof(RECORDINSERT); … … 293 296 294 297 memset(&fsa, 0, sizeof(fsa)); 295 rc = DosQueryFSInfo(toupper(*pCI-> szFileName) - '@', FSIL_ALLOC, &fsa,298 rc = DosQueryFSInfo(toupper(*pCI->pszFileName) - '@', FSIL_ALLOC, &fsa, 296 299 sizeof(FSALLOCATE)); 297 300 if (!rc) { … … 299 302 ((float)fsa.cUnit * (fsa.cSectorUnit * fsa.cbSector)); 300 303 } 301 pCI-> szLongname[1] = 1; // Flag root - hack cough304 pCI->pszLongname[1] = 1; // Flag root - hack cough 302 305 } 303 306 else … … 319 322 CommaFmtULL(szSubDir, sizeof(szSubDir), pCI->easize, 'K'); 320 323 CommaFmtULL(szAllDir, sizeof(szAllDir), pCI->cbFile + pCI->easize, 'K'); 321 sprintf(&pCI-> szFileName[strlen(pCI->szFileName)],324 sprintf(&pCI->pszFileName[strlen(pCI->pszFileName)], 322 325 " %s + %s = %s (%.02lf%%%s)\r%s", 323 326 szCurDir, … … 355 358 } 356 359 if (pciParent) { 357 p = strchr(pciParent-> szFileName, '\r');360 p = strchr(pciParent->pszFileName, '\r'); 358 361 if (p) 359 362 *p = 0; 360 363 fprintf(fp, "%*.*s%s %lu %s%s\n", 361 364 indent * 2, indent * 2, " ", 362 pciParent-> szFileName,365 pciParent->pszFileName, 363 366 pciParent->attrFile, 364 367 GetPString(IDS_FILETEXT), &"s"[pciParent->attrFile == 1]); … … 588 591 LONG clr, x; 589 592 590 p = strchr(pci-> szFileName, '\r');593 p = strchr(pci->pszFileName, '\r'); 591 594 if (p) { 592 595 /* draw text */ … … 600 603 GpiSetMix(oi->hps, FM_OVERPAINT); 601 604 *p = 0; 602 GpiQueryTextBox(oi->hps, strlen(pci-> szFileName),603 pci-> szFileName, TXTBOX_COUNT, aptl);605 GpiQueryTextBox(oi->hps, strlen(pci->pszFileName), 606 pci->pszFileName, TXTBOX_COUNT, aptl); 604 607 ptl.x = oi->rclItem.xLeft; 605 608 ptl.y = (oi->rclItem.yTop - aptl[TXTBOX_TOPRIGHT].y); 606 609 GpiMove(oi->hps, &ptl); 607 GpiCharString(oi->hps, strlen(pci-> szFileName),608 pci-> szFileName);610 GpiCharString(oi->hps, strlen(pci->pszFileName), 611 pci->pszFileName); 609 612 *p = '\r'; 610 613 … … 663 666 /* fill box with graph bar, flags is integer % */ 664 667 if (pci->flags) { 665 if ( pci->szLongname[1]== 1) /* is root record */668 if (*(pci->pszLongname + 1) == 1) /* is root record */ 666 669 GpiSetColor(oi->hps, CLR_DARKGREEN); 667 670 else … … 675 678 676 679 /* draw highlights and shadows on graph */ 677 if ( pci->szLongname[1]== 1)680 if (*(pci->pszLongname + 1) == 1) 678 681 GpiSetColor(oi->hps, CLR_GREEN); 679 682 else … … 692 695 ptl.x = oi->rclItem.xLeft + pci->flags; 693 696 GpiLine(oi->hps, &ptl); 694 if ( pci->szLongname[1]!= 1) {697 if (*(pci->pszLongname + 1) != 1) { 695 698 GpiSetColor(oi->hps, CLR_DARKRED); 696 699 ptl.x = oi->rclItem.xLeft + 2; … … 752 755 while (pci && (INT) pci != -1) { 753 756 memset(szTemp, 0, sizeof(szTemp)); 754 strncpy(szTemp, pci-> szFileName,755 pci->pszFileName - pci-> szFileName);757 strncpy(szTemp, pci->pszFileName, 758 pci->pszFileName - pci->pszFileName); 756 759 strrev(szTemp); 757 760 if (*pszFileName && *szTemp != '\\')
Note:
See TracChangeset
for help on using the changeset viewer.