Changeset 442 for trunk/dll/select.c
- Timestamp:
- Aug 24, 2006, 6:47:13 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/select.c
r406 r442 15 15 13 Jul 06 SHL Use Runtime_Error 16 16 29 Jul 06 SHL Use xfgets_bstripcr 17 15 Aug 06 SHL Rework SetMask args and logic 17 18 18 19 ***********************************************************************/ … … 157 158 } 158 159 159 VOID SelectAll (HWND hwndCnr,BOOL files,BOOL dirs,CHAR *mask ,160 VOID SelectAll (HWND hwndCnr,BOOL files,BOOL dirs,CHAR *maskstr, 160 161 CHAR *text,BOOL is_arc) 161 162 { … … 171 172 textlen = strlen(text); 172 173 memset(&Mask,0,sizeof(Mask)); 173 if (mask && *mask)174 SetMask(mask ,&Mask);174 if (maskstr) 175 SetMask(maskstr,&Mask); 175 176 pci = (PCNRITEM)WinSendMsg(hwndCnr,CM_QUERYRECORD,MPVOID, 176 177 MPFROM2SHORT(CMA_FIRST,CMA_ITEMORDER)); … … 186 187 else 187 188 markit = TRUE; 188 if (mask && *mask&& markit) {189 if (maskstr && *maskstr && markit) { 189 190 markit = FALSE; 190 191 file = strrchr(pci->szFileName,'\\'); … … 258 259 } 259 260 260 VOID DeselectAll (HWND hwndCnr,BOOL files,BOOL dirs,CHAR *mask ,CHAR *text,261 VOID DeselectAll (HWND hwndCnr,BOOL files,BOOL dirs,CHAR *maskstr,CHAR *text, 261 262 BOOL is_arc) 262 263 { … … 271 272 textlen = strlen(text); 272 273 memset(&Mask,0,sizeof(Mask)); 273 if (mask && *mask)274 SetMask(mask ,&Mask);274 if (maskstr && *maskstr) 275 SetMask(maskstr,&Mask); 275 276 pci = (PCNRITEM)WinSendMsg(hwndCnr,CM_QUERYRECORD,MPVOID, 276 277 MPFROM2SHORT(CMA_FIRST,CMA_ITEMORDER)); … … 286 287 else 287 288 unmarkit = TRUE; 288 if (mask && *mask&& unmarkit) {289 if (maskstr && *maskstr && unmarkit) { 289 290 unmarkit = FALSE; 290 291 file = strrchr(pci->szFileName,'\\'); … … 490 491 } 491 492 492 VOID SetMask (CHAR *str,MASK *mask) 493 { 494 register INT x; 495 register CHAR *p; 496 497 if (str != mask->szMask) 498 strcpy(mask->szMask,str); 499 strcpy(mask->szMaskCopy,mask->szMask); 500 memset(mask->pszMasks,0,sizeof(CHAR *) * 26); 501 p = mask->pszMasks[0] = mask->szMaskCopy; 502 for (x = 1;x < 24;x++) { 493 //== SetMask() Convert mask string to array of pointers to masks == 494 495 VOID SetMask (PSZ maskstr,MASK *mask) 496 { 497 UINT x; 498 PSZ p; 499 500 if (maskstr) 501 strcpy(mask->szMask,maskstr); // Got new mask string 502 // Build array of pointers 503 p = mask->szMaskCopy; 504 strcpy(p,mask->szMask); 505 // memset(mask->pszMasks,0,sizeof(mask->pszMasks); // fixme to be gone 506 // Allow up to 25 masks - ignore extras 507 for (x = 0; *p && x < 25; x++) { 508 mask->pszMasks[x] = p; 503 509 while (*p && *p != ';') 504 p++;510 p++; // Find separator 505 511 if (*p) { 506 *p = 0; 512 *p = 0; // Replace ; 507 513 p++; 508 mask->pszMasks[x] = p; 509 } 510 else { 511 mask->pszMasks[x] = NULL; 512 break; 513 } 514 } 515 mask->pszMasks[x] = NULL; 514 } 515 } // for 516 mask->pszMasks[x] = NULL; // Mark end 516 517 } 517 518
Note:
See TracChangeset
for help on using the changeset viewer.