Changeset 544
- Timestamp:
- Dec 21, 2006, 6:41:59 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/dll/walkem.c ¶
r518 r544 14 14 29 Jul 06 SHL Use xfgets 15 15 20 Oct 06 SHL Correct . .. check 16 06 Nov 06 SHL Oops - need to allow .. here 17 14 Nov 06 SHL Correct FillPathListBox regression 16 18 17 19 ***********************************************************************/ … … 264 266 else 265 267 { 266 268 /* if adding manual directory, remove from auto list if present */ 267 269 info = ldirhead; 268 270 temp = NULL; 269 271 while (info) 270 272 { … … 393 395 } 394 396 395 VOID FillPathListBox(HWND hwnd, HWND hwnddrive, HWND hwnddir, CHAR * path,397 VOID FillPathListBox(HWND hwnd, HWND hwnddrive, HWND hwnddir, CHAR *pszPath, 396 398 BOOL nounwriteable) 397 399 { … … 416 418 WinSendMsg(hwnddir, LM_DELETEALL, MPVOID, MPVOID); 417 419 418 if (hwnddrive) 419 { 420 if (hwnddrive) { 421 // Fill drive listbox 420 422 for (sDrive = 0; sDrive < 26; sDrive++) 421 423 { … … 429 431 } 430 432 } 431 if (hwnddrive != hwnddir && p ath && isalpha(*path) && path[1] == ':')432 { 433 *szDrive = toupper(*p ath);433 if (hwnddrive != hwnddir && pszPath && isalpha(*pszPath) && pszPath[1] == ':') 434 { 435 *szDrive = toupper(*pszPath); 434 436 WinSetWindowText(hwnddrive, szDrive); 435 437 } 436 438 } 437 439 438 if (hwnddir) 439 {440 if (hwnddir) { 441 // Fill directory listbox 440 442 sprintf(szTemp, 441 443 "%s%s*", 442 p ath,443 (p ath[strlen(path) - 1] == '\\') ? "" : "\\");444 pszPath, 445 (pszPath[strlen(pszPath) - 1] == '\\') ? "" : "\\"); 444 446 DosError(FERR_DISABLEHARDERR); 445 447 if (!DosFindFirst(szTemp, … … 453 455 FIL_STANDARD)) 454 456 { 455 do 456 { 457 do { 457 458 if (findbuf.attrFile & FILE_DIRECTORY) { 458 if (strlen(path) > 3 || path[1] != ':') { 459 // Skip . and .. too 460 if (findbuf.achName[0] != '.' || 461 (findbuf.achName[1] && 462 (findbuf.achName[1] != '.' || 463 findbuf.achName[2]))) { 459 // Skip .. unless full path supplied 460 if (strcmp(findbuf.achName, "..") || 461 strlen(pszPath) > 3 || pszPath[1] != ':') { 462 // Skip . allow .. 463 if (findbuf.achName[0] != '.' || findbuf.achName[1]) { 464 464 WinSendMsg(hwnddir, 465 465 LM_INSERTITEM, 466 466 MPFROM2SHORT(LIT_SORTASCENDING, 0), 467 467 MPFROMP(findbuf.achName)); 468 468 } 469 469 } 470 470 } 471 471 ulSearchCount = 1L; 472 } 473 while (!DosFindNext(hDir, 474 &findbuf, 475 sizeof(FILEFINDBUF3), 476 &ulSearchCount)); 472 } while (!DosFindNext(hDir, 473 &findbuf, 474 sizeof(FILEFINDBUF3), 475 &ulSearchCount)); 477 476 DosFindClose(hDir); 478 477 } … … 516 515 if (!mp2) 517 516 { 518 517 Runtime_Error2(pszSrcFile, __LINE__, IDS_NODATATEXT); 519 518 WinDismissDlg(hwnd, 0); 520 519 break; … … 823 822 APIRET rc; 824 823 825 824 // *szBuffer = 0; 826 825 // WinQueryDlgItemText(hwnd,WALK_RECENT,CCHMAXPATH,szBuffer); 827 826 if (!*szBuffer) … … 846 845 } 847 846 if (rc) 848 847 Dos_Error(MB_CANCEL,rc,hwnd,pszSrcFile,__LINE__,"DosFindFirst"); 849 848 else if (~findbuf.attrFile & FILE_DIRECTORY) 850 849 Runtime_Error(pszSrcFile, __LINE__, "not a directory"); 851 850 else 852 851 { … … 899 898 } 900 899 if (rc) 901 900 Dos_Error(MB_CANCEL,rc,hwnd,pszSrcFile,__LINE__,"DosFindFirst"); 902 901 else if (~findbuf.attrFile & FILE_DIRECTORY) 903 902 Runtime_Error(pszSrcFile, __LINE__, "not a directory"); 904 903 else 905 904 { … … 1066 1065 MakeFullName(szBuff); 1067 1066 if (!add_udir(TRUE, szBuff)) 1068 1067 Runtime_Error(pszSrcFile, __LINE__, "add_udir"); 1069 1068 else { 1070 1069 WinSendDlgItemMsg(hwnd,
Note:
See TracChangeset
for help on using the changeset viewer.