Changeset 1438
- Timestamp:
- Jun 28, 2009, 10:47:00 PM (16 years ago)
- Location:
- trunk/dll
- Files:
-
- 49 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/arccnrs.c
r1413 r1438 3661 3661 strcpy(dcd->workdir, pFM2SaveDirectory); 3662 3662 MakeTempName(dcd->workdir, ArcTempRoot, 2); 3663 #if 0 // 06 Sep 08 SHL fixme to be gone3664 if (dcd->workdir[strlen(dcd->workdir) - 1] != '\\')3665 strcat(dcd->workdir, "\\");3666 sprintf(dcd->workdir + strlen(dcd->workdir), "%s.%03x",3667 ArcTempRoot, (clock() & 4095));3668 else3669 sprintf(dcd->workdir, "%s.%03x",3670 ArcTempRoot, (clock() & 4095));3671 #endif // 06 Sep 08 SHL fixme to be gone3672 3663 strcpy(dcd->arcname, fullname); 3673 3664 if (*extractpath) { -
trunk/dll/autoview.c
r1400 r1438 136 136 } 137 137 138 rc = DosAllocMem((PPVOID) & pfealist, ealen, PAG_COMMIT | PAG_READ |139 138 rc = xDosAllocMem((PPVOID) & pfealist, ealen, PAG_COMMIT | PAG_READ | 139 PAG_WRITE | OBJ_TILE); 140 140 if (rc || !pfealist) 141 141 Dos_Error(MB_CANCEL, rc, hwnd, pszSrcFile, __LINE__, … … 329 329 stopflag--; 330 330 if (fAutoView) { 331 WinSetWindowText((fComments) ? hwndAutoMLE : hwndAutoview, "");331 WinSetWindowText((fComments) ? hwndAutoMLE : hwndAutoview, NullStr); 332 332 MLEsetreadonly(hwndAutoMLE, TRUE); 333 333 MLEsetchanged(hwndAutoMLE, FALSE); … … 394 394 if (info) { 395 395 sprintf(p, "**%s%s%s\n", 396 info->id ? info->id : "",397 info->id ? " " : "",396 info->id ? info->id : NullStr, 397 info->id ? " " : NullStr, 398 398 GetPString(IDS_ARCHIVETEXT)); 399 399 p += strlen(p); … … 511 511 "%s%-*.*s %-8s [%s%s%s%s] %s " 512 512 "%02lu%s%02lu%s%02lu\r", 513 pffbFile->attrFile & FILE_DIRECTORY ? "\\": " ",513 pffbFile->attrFile & FILE_DIRECTORY ? PCSZ_BACKSLASH : " ", 514 514 ml, 515 515 ml, -
trunk/dll/avl.c
r1402 r1438 650 650 ditem.hstrType = DrgAddStrHandle(DRT_UNKNOWN); 651 651 ditem.hstrRMF = DrgAddStrHandle(DRMDRF_LBOX); 652 ditem.hstrContainerName = DrgAddStrHandle( "");653 ditem.hstrSourceName = DrgAddStrHandle( "");654 ditem.hstrTargetName = DrgAddStrHandle( "");652 ditem.hstrContainerName = DrgAddStrHandle(NullStr); 653 ditem.hstrSourceName = DrgAddStrHandle(NullStr); 654 ditem.hstrTargetName = DrgAddStrHandle(NullStr); 655 655 // ditem.fsControl = 0; 656 656 ditem.fsSupportedOps = DO_MOVEABLE; -
trunk/dll/cmdline.c
r1398 r1438 20 20 19 Jul 08 GKY Replace save_dir2(dir) with pFM2SaveDirectory and use BldFullPathName 21 21 24 Aug 08 GKY Warn full drive on save of .DAT file; prevent loss of existing file 22 28 Jun 09 GKY Added AddBackslashToPath() to remove repeatative code. 22 23 23 24 ***********************************************************************/ … … 403 404 return 0; 404 405 if (*ex->path) { 405 strcpy(executable, ex->path); 406 if (executable[strlen(executable) - 1] != '\\') 407 strcat(executable, "\\"); 406 strcpy(executable, ex->path); 407 AddBackslashToPath(executable); 408 //if (executable[strlen(executable) - 1] != '\\') 409 // strcat(executable, "\\"); 408 410 } 409 411 else -
trunk/dll/common.c
r1400 r1438 518 518 (swp->cy - 519 519 WinQuerySysValue(HWND_DESKTOP, 520 SV_CYSIZEBORDER)) - 30, 520 SV_CYSIZEBORDER)) - 521 (DRIVE_BUTTON_HEIGHT), 521 522 swp->cx - 522 523 (WinQuerySysValue(HWND_DESKTOP, 523 524 SV_CXSIZEBORDER) * 2), 524 30,525 DRIVE_BUTTON_HEIGHT, 525 526 hwndFrame, HWND_TOP, MAIN_DRIVES, NULL, NULL); 526 527 … … 859 860 (*s) ? s : NullStr, (*s) ? " " : NullStr, 860 861 directory, 861 (directory[strlen(directory) - 1] == '\\') ? "\\": NullStr);862 (directory[strlen(directory) - 1] == '\\') ? PCSZ_BACKSLASH : NullStr); 862 863 } 863 864 return hwndDir; -
trunk/dll/comp.c
r1409 r1438 66 66 08 Mar 09 GKY Additional strings move to PCSZs in init.c & String Table 67 67 15 Mar 09 GKY Use WriteDetailsSwitchs to save detail switch changes to the ini file. 68 28 Jun 09 GKY Added AddBackslashToPath() to remove repeatative code. 68 69 69 70 ***********************************************************************/ … … 2899 2900 strcpy(ofile, cmp->rightdir); 2900 2901 else 2901 strcpy(ofile, cmp->leftdir); 2902 if (ofile[strlen(ofile) - 1] != '\\') 2903 strcat(ofile, "\\"); 2902 strcpy(ofile, cmp->leftdir); 2903 AddBackslashToPath(ofile); 2904 //if (ofile[strlen(ofile) - 1] != '\\') 2905 // strcat(ofile, "\\"); 2904 2906 strcat(ofile, pci->pszDisplayName); 2905 2907 if (*compare) { -
trunk/dll/copyf.c
r1402 r1438 21 21 19 Jul 08 GKY Modify MakeTempName for use making temp directory names 22 22 08 Mar 09 GKY Removed variable aurguments from docopyf and unlinkf (not used) 23 28 Jun 09 GKY Added AddBackslashToPath() to remove repeatative code. 23 24 24 25 ***********************************************************************/ … … 50 51 #include "wrappers.h" // xDosSetPathInfo 51 52 #include "strips.h" // bstrip 52 #include "fortify.h" 53 #include "fortify.h" 54 #include "pathutil.h" // AddBackslashToPath 53 55 54 56 static PSZ pszSrcFile = __FILE__; … … 75 77 char *p, *o; 76 78 77 if (strlen(buffer) > 3 && buffer[strlen(buffer) - 1] != '\\') 78 strcat(buffer, "\\"); 79 80 if (strlen(buffer) > 3) // && buffer[strlen(buffer) - 1] != '\\') 81 AddBackslashToPath(buffer); 82 //strcat(buffer, "\\"); 79 83 p = o = buffer + strlen(buffer); 80 84 switch (type) { … … 282 286 BOOL ZapLongName(char *filename) 283 287 { 284 return WriteLongName(filename, "");288 return WriteLongName(filename, NullStr); 285 289 } 286 290 … … 308 312 else 309 313 ealen = sizeof(FEALIST) + 10; 310 rc = DosAllocMem((PPVOID) & pfealist,311 ealen + 32L, OBJ_TILE | PAG_COMMIT | PAG_READ | PAG_WRITE);314 rc = xDosAllocMem((PPVOID) & pfealist, 315 ealen + 32L, OBJ_TILE | PAG_COMMIT | PAG_READ | PAG_WRITE); 312 316 if (rc) 313 317 Dos_Error(MB_CANCEL, rc, HWND_DESKTOP, pszSrcFile, __LINE__, … … 536 540 if (IsFile(newname) != -1 && stricmp(oldname, newname)) { 537 541 strcpy(dir, newname); 538 p = strrchr(dir, '\\'); 539 if (p) 540 *p = 0; 541 strcat(dir, "\\"); 542 AddBackslashToPath(dir); 543 //p = strrchr(dir, '\\'); 544 //if (p) 545 // *p = 0; 546 //strcat(dir, "\\"); 542 547 MakeTempName(dir, NULL, 0); 543 548 if (DosMove(newname, dir)) -
trunk/dll/datamin.c
r1400 r1438 852 852 APIRET rc; 853 853 854 rc = DosAllocMem((PVOID)&pbh, USHRT_MAX + 4096,855 854 rc = xDosAllocMem((PVOID)&pbh, USHRT_MAX + 4096, 855 PAG_COMMIT | OBJ_TILE | PAG_READ | PAG_WRITE); 856 856 if (rc) 857 857 Dos_Error(MB_CANCEL, rc, hwnd, pszSrcFile, __LINE__, … … 891 891 APIRET rc; 892 892 893 rc = DosAllocMem((PVOID) & pbh, USHRT_MAX + 4096,894 PAG_COMMIT | OBJ_TILE | PAG_READ | PAG_WRITE);893 rc = xDosAllocMem((PVOID) & pbh, USHRT_MAX + 4096, 894 PAG_COMMIT | OBJ_TILE | PAG_READ | PAG_WRITE); 895 895 if (rc) 896 896 Dos_Error(MB_CANCEL, rc, hwnd, pszSrcFile, __LINE__, -
trunk/dll/dircnrs.c
r1412 r1438 64 64 29 Mar 09 SHL Keep more keys away from PM if extended search in progress 65 65 29 Mar 09 SHL Increase extended search timeout to 3 seconds 66 28 Jun 09 GKY Added AddBackslashToPath() to remove repeatative code. 66 67 67 68 ***********************************************************************/ … … 141 142 #include "fortify.h" 142 143 #include "excputil.h" // 06 May 08 SHL added 144 #include "pathutil.h" // AddBackslashToPath 143 145 144 146 // Data definitions … … 1815 1817 PCNRITEM pci; 1816 1818 1817 strcpy(newfile, dcd->directory); 1818 if (newfile[strlen(newfile) - 1] != '\\') 1819 strcat(newfile, "\\"); 1819 strcpy(newfile, dcd->directory); 1820 AddBackslashToPath(newfile); 1821 //if (newfile[strlen(newfile) - 1] != '\\') 1822 // strcat(newfile, "\\"); 1820 1823 strcat(newfile, sip.ret); 1821 1824 test = IsFile(newfile); … … 2440 2443 CHAR tempname1[CCHMAXPATH], tempname2[CCHMAXPATH]; 2441 2444 2442 strcpy(tempname1, dcd->directory); 2443 if (tempname1[strlen(tempname1) - 1] != '\\') 2444 strcat(tempname1, "\\"); 2445 strcpy(tempname1, dcd->directory); 2446 AddBackslashToPath(tempname1); 2447 //if (tempname1[strlen(tempname1) - 1] != '\\') 2448 // strcat(tempname1, "\\"); 2445 2449 strcat(tempname1, ".."); 2446 2450 DosError(FERR_DISABLEHARDERR); -
trunk/dll/dirs.c
r1346 r1438 89 89 if ((CHAR) ((CHAR) curdrive + '@') != (CHAR) toupper(*HomePath) && 90 90 (CHAR) ((CHAR) curdrive + '@') != (CHAR) toupper(*path)) 91 DosChDir( "\\");91 DosChDir(PCSZ_BACKSLASH); 92 92 } 93 93 ret = DosSelectDisk(toupper(*path) - '@'); -
trunk/dll/dirsize.c
r1435 r1438 45 45 08 Mar 09 GKY Renamed commafmt.h i18nutil.h 46 46 08 Mar 09 GKY Additional strings move to PCSZs in init.c 47 28 Jun 09 GKY Added AddBackslashToPath() to remove repeatative code. 47 48 48 49 ***********************************************************************/ … … 85 86 #include "fortify.h" 86 87 #include "excputil.h" // xbeginthread 88 #include "pathutil.h" // AddBackslashToPath 87 89 88 90 typedef struct … … 151 153 152 154 strcpy(maskstr, pszFileName); 153 if (maskstr[strlen(maskstr) - 1] != '\\') 154 strcat(maskstr, "\\"); 155 AddBackslashToPath(maskstr); 156 //if (maskstr[strlen(maskstr) - 1] != '\\') 157 // strcat(maskstr, "\\"); 155 158 pEndMask = &maskstr[strlen(maskstr)]; // Point after last backslash 156 159 strcat(maskstr, "*"); … … 873 876 memset(szTemp, 0, sizeof(szTemp)); 874 877 strcpy(szTemp, pci->pszFileName); 875 strrev(szTemp); 876 if (*szFileName && *szTemp != '\\') 877 strcat(szFileName, "\\"); 878 strrev(szTemp); 879 AddBackslashToPath(szFileName); 880 //if (*szFileName && *szTemp != '\\') 881 // strcat(szFileName, "\\"); 878 882 strcat(szFileName, szTemp); 879 883 pci = WinSendDlgItemMsg(hwnd, DSZ_CNR, CM_QUERYRECORD, … … 951 955 else 952 956 strcpy(szFileName, pFM2SaveDirectory); 953 sprintf(&szFileName[strlen(szFileName)], " \\%csizes.Rpt",957 sprintf(&szFileName[strlen(szFileName)], "%s%csizes.Rpt", PCSZ_BACKSLASH, 954 958 (pState) ? toupper(*pState->szDirName) : '+'); 955 959 if (export_filename(hwnd, szFileName, FALSE) && *szFileName) { -
trunk/dll/draglist.c
r1402 r1438 152 152 p++; 153 153 strcpy(szFile, p); 154 strcat(szDir, "\\");154 strcat(szDir, PCSZ_BACKSLASH); 155 155 } 156 156 else { … … 809 809 p++; 810 810 strcpy(szFile, p); 811 strcat(szDir, "\\");811 strcat(szDir, PCSZ_BACKSLASH); 812 812 } 813 813 else { -
trunk/dll/eas.c
r1402 r1438 198 198 199 199 ealen = sizeof(FEA2LIST) + strlen(s) + 64; 200 rc = DosAllocMem((PPVOID) & pfealist, ealen + 1,201 OBJ_TILE | PAG_COMMIT | PAG_READ | PAG_WRITE);200 rc = xDosAllocMem((PPVOID) & pfealist, ealen + 1, 201 OBJ_TILE | PAG_COMMIT | PAG_READ | PAG_WRITE); 202 202 if (rc) 203 203 Dos_Error(MB_CANCEL, rc, HWND_DESKTOP, pszSrcFile, __LINE__, … … 1064 1064 } 1065 1065 1066 rc = DosAllocMem((PPVOID) & pfealist, ealen,1067 OBJ_TILE | PAG_COMMIT | PAG_READ | PAG_WRITE);1066 rc = xDosAllocMem((PPVOID) & pfealist, ealen, 1067 OBJ_TILE | PAG_COMMIT | PAG_READ | PAG_WRITE); 1068 1068 if (rc) 1069 1069 Dos_Error(MB_CANCEL, rc, HWND_DESKTOP, pszSrcFile, __LINE__, -
trunk/dll/filldir.c
r1435 r1438 70 70 14 Mar 09 GKY Prevent execution of UM_SHOWME while drive scan is occuring 71 71 06 Jun 09 GKY Add option to show file system type or drive label in tree 72 28 Jun 09 GKY Added AddBackslashToPath() to remove repeatative code. 72 73 73 74 ***********************************************************************/ … … 110 111 #include "excputil.h" // xbeginthread 111 112 #include "fm3dlg.h" // INFO_LABEL 113 #include "pathutil.h" // AddBackslashToPath 112 114 113 115 VOID StubbyScanThread(VOID * arg); … … 968 970 969 971 PSZ pszFileSpec; 970 INT t;972 //INT t; 971 973 PFILEFINDBUF4L paffbFound; 972 974 PFILEFINDBUF4L *papffbSelected; … … 983 985 ULONG ulReturnFiles = 0; 984 986 ULONGLONG ullReturnBytes = 0; 985 PCH pchEndPath;987 //PCH pchEndPath; 986 988 APIRET rc; 987 989 PCNRITEM pci; … … 1013 1015 1014 1016 if (paffbFound && papffbSelected && pszFileSpec) { 1015 t = strlen(szDirBase); 1016 memcpy(pszFileSpec, szDirBase, t + 1); 1017 pchEndPath = pszFileSpec + t; 1018 if (*(pchEndPath - 1) != '\\') { 1019 memcpy(pchEndPath, "\\", 2); 1020 pchEndPath++; 1021 } 1022 memcpy(pchEndPath, "*", 2); 1017 //t = strlen(szDirBase); 1018 strcpy(pszFileSpec, szDirBase); 1019 AddBackslashToPath(pszFileSpec); 1020 //pchEndPath = pszFileSpec + t; 1021 //if (*(pchEndPath - 1) != '\\') { 1022 // memcpy(pchEndPath, "\\", 2); 1023 // pchEndPath++; 1024 //} 1025 strcat(pszFileSpec, "*"); 1023 1026 DosError(FERR_DISABLEHARDERR); 1024 1027 ulFindCnt = ulFindMax; … … 1033 1036 FIL_QUERYEASIZEL); 1034 1037 priority_normal(); 1035 *pchEndPath = 0; // Chop off wildcard 1038 pszFileSpec[strlen(pszFileSpec) - 1] = 0; // Chop off wildcard 1039 //*pchEndPath = 0; 1036 1040 if (!rc) { 1037 1041 do { … … 1457 1461 } 1458 1462 } 1459 if (strcmp(volser.volumelabel, "") != 0 && FSInfo && fShowDriveLabelInTree)1463 if (strcmp(volser.volumelabel, NullStr) != 0 && FSInfo && fShowDriveLabelInTree) 1460 1464 strcpy(szFSType, volser.volumelabel); 1461 1465 pci->rc.flRecordAttr |= CRA_RECORDREADONLY; -
trunk/dll/fm2cmd.c
r1402 r1438 10 10 11 11 20 Aug 07 GKY Move #pragma alloc_text to end for OpenWatcom compat 12 28 Jun 09 GKY Added AddBackslashToPath() to remove repeatative code. 12 13 13 14 ***********************************************************************/ … … 31 32 #include "misc.h" // PostMsg 32 33 #include "delims.h" // skip_delim 34 #include "pathutil.h" // AddBackslashToPath 33 35 34 36 … … 55 57 if (*name != '\\' && *name != '/') { 56 58 strcpy(temp, directory); 57 if (directory[strlen(directory) - 1] != '\\') 58 strcat(temp, "\\"); 59 AddBackslashToPath(directory); 60 //if (directory[strlen(directory) - 1] != '\\') 61 // strcat(temp, "\\"); 59 62 } 60 63 else { -
trunk/dll/fortify.c
r1078 r1438 1571 1571 } 1572 1572 1573 sprintf(st_Buffer, "%02x%s", *ptr, ((column % 4) == 3) ? " " : "");1573 sprintf(st_Buffer, "%02x%s", *ptr, ((column % 4) == 3) ? " " : NullStr); 1574 1574 st_Output(st_Buffer); 1575 1575 -
trunk/dll/getnames.c
r1402 r1438 12 12 20 Aug 07 GKY Move #pragma alloc_text to end for OpenWatcom compat 13 13 08 Mar 09 GKY Removed variable aurguments from docopyf and unlinkf (not used) 14 28 Jun 09 GKY Added AddBackslashToPath() to remove repeatative code. 14 15 15 16 ***********************************************************************/ … … 38 39 #include "misc.h" // PaintRecessedWindow 39 40 #include "wrappers.h" // xDosFindFirst 41 #include "pathutil.h" // AddBackslashToPath 40 42 41 43 #pragma data_seg(DATA1) … … 179 181 MPFROM2SHORT(sSelect, 180 182 CCHMAXPATH), MPFROMP(szBuffer)); 181 if (*szBuffer) { 182 if (szBuffer[strlen(szBuffer) - 1] != '\\') 183 strcat(szBuffer, "\\"); 183 if (*szBuffer) { 184 AddBackslashToPath(szBuffer); 185 //if (szBuffer[strlen(szBuffer) - 1] != '\\') 186 // strcat(szBuffer, "\\"); 184 187 *szTemp = 0; 185 188 WinQueryDlgItemText(hwnd, 258, CCHMAXPATH, szTemp); -
trunk/dll/grep.c
r1402 r1438 32 32 07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook. 33 33 08 Mar 09 GKY Additional strings move to String Table 34 28 Jun 09 GKY Added AddBackslashToPath() to remove repeatative code. 34 35 35 36 ***********************************************************************/ … … 475 476 476 477 // add a mask to search path 477 if (searchPath[strlen(searchPath) - 1] != '\\') 478 strcat(searchPath, "\\"); 478 AddBackslashToPath(searchPath); 479 //if (searchPath[strlen(searchPath) - 1] != '\\') 480 // strcat(searchPath, "\\"); 479 481 strcat(searchPath, "*"); 480 482 // step through all subdirectories -
trunk/dll/grep2.c
r1400 r1438 367 367 strcpy(simple, p); 368 368 else if (*s) { 369 strcpy(simple, "\\");369 strcpy(simple, PCSZ_BACKSLASH); 370 370 strcat(simple, s); 371 371 *s = 0; … … 590 590 if (s[strlen(s) - 1] != '\\') { 591 591 lLen++; 592 strcat(s, "\\");592 strcat(s, PCSZ_BACKSLASH); 593 593 } 594 594 rstrip(s); … … 647 647 if (s[strlen(s) - 1] != '\\') { 648 648 lLen++; 649 strcat(s, "\\");649 strcat(s, PCSZ_BACKSLASH); 650 650 } 651 651 rstrip(s); -
trunk/dll/init.c
r1436 r1438 80 80 saved drive containers. 81 81 06 Jun 09 GKY Add option to show file system type or drive label in tree 82 28 Jun 09 GKY Added AddBackslashToPath() to remove repeatative code. 82 83 83 84 ***********************************************************************/ … … 281 282 PCSZ PCSZ_FILLDIRQCURERRTEXT = "DosQCurDisk"; 282 283 PCSZ PCSZ_NODATA = "No Data"; 284 PCSZ PCSZ_BACKSLASH = "\\"; 283 285 PCSZ PCSZ_STARDOTEXE = "*.EXE"; 284 286 PCSZ PCSZ_STARDOTINI = "*.INI"; … … 520 522 fcloseall(); 521 523 save_dir(s); 522 if (s[strlen(s) - 1] != '\\') 523 strcat(s, "\\"); 524 AddBackslashToPath(s); 525 //if (s[strlen(s) - 1] != '\\') 526 // strcat(s, "\\"); 524 527 enddir = &s[strlen(s)]; 525 528 if (*ArcTempRoot) { … … 552 555 else 553 556 strcpy(s, pFM2SaveDirectory); 554 if (s[strlen(s) - 1] != '\\') 555 strcat(s, "\\"); 557 AddBackslashToPath(s); 558 //if (s[strlen(s) - 1] != '\\') 559 // strcat(s, "\\"); 556 560 enddir = &s[strlen(s)]; 557 561 strcat(s, "$FM2LI$T."); … … 699 703 700 704 strcpy(szTempName, env); 701 if (szTempName[strlen(szTempName) - 1] != '\\') 702 strcat(szTempName, "\\"); 705 AddBackslashToPath(szTempName); 706 //if (szTempName[strlen(szTempName) - 1] != '\\') 707 // strcat(szTempName, "\\"); 703 708 enddir = &szTempName[strlen(szTempName)]; 704 709 strcat(szTempName, "$FM2????."); -
trunk/dll/init.h
r1436 r1438 107 107 extern PCSZ PCSZ_FILLDIRQCURERRTEXT; 108 108 extern PCSZ PCSZ_NODATA; 109 extern PCSZ PCSZ_BACKSLASH; 109 110 extern PCSZ PCSZ_STARDOTEXE; 110 111 extern PCSZ PCSZ_STARDOTINI; -
trunk/dll/instant.c
r1398 r1438 34 34 #include "systemf.h" // runemf2 35 35 #include "strips.h" // bstrip 36 #include "wrappers.h" // xDosAllocMem 37 #include "init.h" // Strings 36 38 37 39 #pragma data_seg(DATA1) … … 101 103 mem = MLEgetlen(hwndMLE); 102 104 if (mem) { 103 rc = DosAllocMem((PVOID) & bat, mem,104 PAG_COMMIT | PAG_READ | PAG_WRITE);105 rc = xDosAllocMem((PVOID) & bat, mem, 106 PAG_COMMIT | PAG_READ | PAG_WRITE); 105 107 if (rc || !bat) { 106 108 Dos_Error(MB_CANCEL, rc, HWND_DESKTOP, pszSrcFile, __LINE__, … … 132 134 else { 133 135 sprintf(s, "%s%sFMTMP%d.CMD", path, 134 (path[strlen(path) - 1] == '\\') ? "" : "\\",136 (path[strlen(path) - 1] == '\\') ? NullStr : PCSZ_BACKSLASH, 135 137 batches++); 136 138 fp = fopen(s, "w"); … … 144 146 fprintf(fp, "%s%c:%s\n", rexx, toupper(*path), rexx); 145 147 fprintf(fp, "%sCD \"%s%s\"%s\n", rexx, path, 146 (strlen(path) < 3) ? "\\" : "", rexx);148 (strlen(path) < 3) ? PCSZ_BACKSLASH : NullStr, rexx); 147 149 fprintf(fp, "%s", bat); 148 150 fprintf(fp, "\n%sDEL \"%s\"%s\n", rexx, s, rexx); … … 169 171 GetPString(IDS_INSTANTHELPTITLETEXT), 170 172 GetPString(IDS_INSTANTHELPTEXT), 171 path, (strlen(path) < 3) ? "\\" : "", path,172 (path[strlen(path) - 1] == '\\') ? "" : "\\", batches);173 path, (strlen(path) < 3) ? PCSZ_BACKSLASH : NullStr, path, 174 (path[strlen(path) - 1] == '\\') ? NullStr : PCSZ_BACKSLASH, batches); 173 175 if (rc == MBID_YES) 174 176 runemf2(WINDOWED | INVISIBLE | BACKGROUND, -
trunk/dll/killproc.c
r1402 r1438 116 116 117 117 WinSendDlgItemMsg(hwnd, KILL_LISTBOX, LM_DELETEALL, MPVOID, MPVOID); 118 rc = DosAllocMem((PVOID) & pbh, USHRT_MAX + 4096,119 PAG_COMMIT | OBJ_TILE | PAG_READ | PAG_WRITE);118 rc = xDosAllocMem((PVOID) & pbh, USHRT_MAX + 4096, 119 PAG_COMMIT | OBJ_TILE | PAG_READ | PAG_WRITE); 120 120 if (rc) 121 121 Dos_Error(MB_CANCEL, rc, HWND_DESKTOP, pszSrcFile, __LINE__, … … 185 185 186 186 WinSendDlgItemMsg(hwnd, KILL_LISTBOX, LM_DELETEALL, MPVOID, MPVOID); 187 rc = DosAllocMem((PVOID) & pbh, USHRT_MAX + 4096,188 PAG_COMMIT | OBJ_TILE | PAG_READ | PAG_WRITE);187 rc = xDosAllocMem((PVOID) & pbh, USHRT_MAX + 4096, 188 PAG_COMMIT | OBJ_TILE | PAG_READ | PAG_WRITE); 189 189 if (rc) 190 190 Dos_Error(MB_CANCEL, rc, HWND_DESKTOP, pszSrcFile, __LINE__, -
trunk/dll/literal.c
r1416 r1438 35 35 #include "wrappers.h" // xmalloc 36 36 #include "fortify.h" 37 #include "init.h" // Strings 37 38 38 39 static PSZ pszSrcFile = __FILE__; … … 321 322 } 322 323 else { 323 sprintf(pchOut, " \\x%02x", (UCHAR)*pchIn);324 sprintf(pchOut, "%sx%02x", PCSZ_BACKSLASH, (UCHAR)*pchIn); 324 325 pchOut += 4; 325 326 } -
trunk/dll/loadbmp.c
r1209 r1438 45 45 46 46 strcpy(s, pFM2SaveDirectory); 47 sprintf(s + strlen(s), " \\%u.BMP", id);47 sprintf(s + strlen(s), "%s%u.BMP", PCSZ_BACKSLASH, id); 48 48 return LoadBitmapFromFile(s); 49 49 } -
trunk/dll/mainwnd.c
r1436 r1438 1891 1891 { 1892 1892 HPS hps; 1893 POINTL aptl[4] = { 0, 0, DRIVE_BUTTON_WIDTH - 1, DRIVE_BUTTON_HEIGTH - 1, 1894 0, 0, 27, 20}; //The last 2 numbers should be the width and heigth of the bitmap 1893 POINTL aptl[4] = {0, 0, DRIVE_BUTTON_WIDTH - 1, DRIVE_BUTTON_HEIGHT - 1, 1894 0, 0, DRIVE_BUTTON_WIDTH - 1, DRIVE_BUTTON_HEIGHT - 1}; 1895 //The last 2 numbers should be the width and height of the bitmap 1895 1896 HBITMAP hbm; 1897 PBITMAPINFOHEADER pbmpData; 1896 1898 POINTL ptlStart; 1897 1899 ULONG x, iconid; … … 1920 1922 } 1921 1923 else 1922 1924 iconid = FLOPPY_ICON; 1923 1925 hps = WinBeginPaint(hwnd, (HPS) 0, NULL); 1924 1926 if (hps) { 1925 1927 hbm = GpiLoadBitmap(hps, 0, iconid, 0, 0); 1926 if (hbm) 1928 if (hbm) { 1929 pbmpData = xmallocz(sizeof(PBITMAPINFOHEADER), pszSrcFile, __LINE__); 1930 if (pbmpData) { 1931 GpiQueryBitmapParameters(hbm, pbmpData); 1932 aptl[1].x = pbmpData->cx; 1933 aptl[1].y = pbmpData->cy; 1934 aptl[3].x = pbmpData->cx; 1935 aptl[3].y = pbmpData->cy; 1936 free(pbmpData); 1937 } 1927 1938 GpiWCBitBlt(hps, hbm, 4L, aptl, ROP_SRCCOPY, BBO_PAL_COLORS); 1928 memset(&fat, 0, sizeof(fat)); 1929 fat.usRecordLength = sizeof(FATTRS); 1930 fat.fsSelection = FATTR_SEL_BOLD ; 1931 fat.usCodePage = 850; 1932 fat.fsFontUse = FATTR_FONTUSE_NOMIX; 1933 strcpy(fat.szFacename , FNT_HELVETICA); 1939 } 1940 memset(&fat, 0, sizeof(fat)); 1941 fat.usRecordLength = sizeof(FATTRS); 1942 fat.fsSelection = FATTR_SEL_BOLD ; 1943 fat.usCodePage = 850; 1944 fat.fsFontUse = FATTR_FONTUSE_NOMIX; 1945 strcpy(fat.szFacename , FNT_HELVETICA); 1934 1946 x = GpiCreateLogFont(hps, NULL, DRIVEBAR_FONT_LCID, &fat); 1935 1947 if (x != GPI_ERROR) { … … 1940 1952 GpiSetColor(hps, iconid == RAMDISK_ICON ? CLR_YELLOW : CLR_DARKBLUE); 1941 1953 ptlStart.x = 1L; //Char box position 1942 ptlStart.y = 7L;1954 ptlStart.y = 8L; 1943 1955 GpiCharStringAt(hps, &ptlStart, strlen(szDrv), szDrv); 1944 1956 GpiDeleteSetId(hps, DRIVEBAR_FONT_LCID); … … 1989 2001 UINT iDrv; 1990 2002 1991 strcat(szDrv, "\\");2003 strcat(szDrv, PCSZ_BACKSLASH); 1992 2004 MakeValidDir(szDrv); 1993 2005 // Disable menus if MakeValidDir changes drive letter fixme this section doesn't do anything see treecnt.c … … 2036 2048 strcpy(szDrv + 1, ":"); 2037 2049 if (isalpha(*szDrv)) { 2038 strcat(szDrv, "\\");2050 strcat(szDrv, PCSZ_BACKSLASH); 2039 2051 if (!FindDirCnrByName(szDrv, TRUE)) 2040 2052 OpenDirCnr((HWND) 0, hwndMain, hwndTree, FALSE, szDrv); … … 2051 2063 strcpy(szDrv + 1, ":"); 2052 2064 if (isalpha(*szDrv)) { 2053 strcat(szDrv, "\\");2065 strcat(szDrv, PCSZ_BACKSLASH); 2054 2066 CommonDriveCmd(hwnd, szDrv, SHORT1FROMMP(mp1)); 2055 2067 } … … 2120 2132 if (li) { 2121 2133 strcpy(li->targetpath, szDrv); 2122 strcat(li->targetpath, "\\");2134 strcat(li->targetpath, PCSZ_BACKSLASH); 2123 2135 if (li->list && li->list[0] && IsRoot(li->list[0])) 2124 2136 li->type = DO_LINK; … … 2282 2294 0, 2283 2295 DRIVE_BUTTON_WIDTH, 2284 DRIVE_BUTTON_HEIG TH,2296 DRIVE_BUTTON_HEIGHT, 2285 2297 hwndT, HWND_TOP, x + IDM_DRIVEA, NULL, NULL); 2286 2298 if (!hwndB) … … 2299 2311 VOID ResizeDrives(HWND hwndT, long xwidth) 2300 2312 { 2301 register ULONG ctrlxpos = 2, ctrlypos = 0, ctrlxsize;2313 register ULONG ctrlxpos = 1, ctrlypos = 0, ctrlxsize; 2302 2314 HENUM henum; 2303 2315 HWND hwndB; … … 2310 2322 WinQueryWindowRect(hwndT, &rcl); 2311 2323 xwidth = rcl.xRight - ((WinQuerySysValue(HWND_DESKTOP, 2312 SV_CYSIZEBORDER) * 2) + 2);2324 SV_CYSIZEBORDER) * 2) + 1); 2313 2325 } 2314 2326 henum = WinBeginEnumWindows(hwndT); … … 2317 2329 WinSetWindowPos(hwndB, 2318 2330 HWND_TOP, 2319 ctrlxpos, ctrlypos, ctrlxsize, DRIVE_BUTTON_HEIG TH, SWP_MOVE | SWP_SHOW);2331 ctrlxpos, ctrlypos, ctrlxsize, DRIVE_BUTTON_HEIGHT, SWP_MOVE | SWP_SHOW); 2320 2332 ctrlxpos += (ctrlxsize + 2); 2321 if (ctrlxpos + (DRIVE_BUTTON_WIDTH + 4+ ((fShowTarget && DriveLines == 0) ?2333 if (ctrlxpos + (DRIVE_BUTTON_WIDTH + 2 + ((fShowTarget && DriveLines == 0) ? 2322 2334 256 : 0)) > xwidth) { 2323 ctrlxpos = 2;2324 ctrlypos += DRIVE_BUTTON_HEIG TH;2335 ctrlxpos = 1; 2336 ctrlypos += DRIVE_BUTTON_HEIGHT; 2325 2337 DriveLines++; 2326 2338 } … … 3998 4010 (WinQuerySysValue(HWND_DESKTOP, 3999 4011 SV_CYSIZEBORDER) * 2)) - 4)); 4000 prectl->yTop -= (16 * (DriveLines * DRIVE_BUTTON_HEIG TH));4012 prectl->yTop -= (16 * (DriveLines * DRIVE_BUTTON_HEIGHT)); 4001 4013 } 4002 4014 if (fUserComboBox) { … … 4027 4039 PSWP pswp, pswpClient, pswpNew; 4028 4040 SWP swpClient; 4029 LONG theight = 48L, dheight = DRIVE_BUTTON_HEIG TH + 2, width, sheight = 20, bheight = 20;4041 LONG theight = 48L, dheight = DRIVE_BUTTON_HEIGHT, width, sheight = 20, bheight = 20; 4030 4042 4031 4043 sCount = (SHORT) oldproc(hwnd, msg, mp1, mp2); … … 4136 4148 pswpNew->hwndInsertBehind = HWND_BOTTOM; 4137 4149 pswpNew->x = swpClient.x + 2; 4138 dheight += ((dheight - 2) * DriveLines);4139 pswpNew->y = (swpClient.y + swpClient.cy) - (dheight - 2);4150 dheight += ((dheight) * DriveLines); 4151 pswpNew->y = (swpClient.y + swpClient.cy) - (dheight); 4140 4152 if (fToolbar) 4141 4153 pswpNew->y -= theight; 4142 4154 pswpNew->cx = swpClient.cx - 4; 4143 pswpNew->cy = dheight - 4;4155 pswpNew->cy = dheight; 4144 4156 pswpClient->cy -= dheight; 4145 4157 sCount++; -
trunk/dll/mainwnd.h
r1437 r1438 24 24 25 25 #define DRIVE_BUTTON_WIDTH 28 26 #define DRIVE_BUTTON_HEIG TH2126 #define DRIVE_BUTTON_HEIGHT 21 27 27 28 28 void BubbleHelp(HWND hwnd, BOOL other, BOOL data, BOOL above, PCSZ help); -
trunk/dll/mainwnd2.c
r1437 r1438 224 224 PSWP pswp, pswpClient, pswpNew; 225 225 SWP swpClient; 226 ULONG theight = 48L, dheight = DRIVE_BUTTON_HEIG TH + 2, bheight = 20, sheight = 20;226 ULONG theight = 48L, dheight = DRIVE_BUTTON_HEIGHT, bheight = 20, sheight = 20; 227 227 LONG width, lastx; 228 228 … … 310 310 pswpNew->hwnd = WinWindowFromID(hwnd, MAIN_DRIVES); 311 311 pswpNew->x = swpClient.x + 2; 312 dheight += ((dheight - 2) * DriveLines);313 pswpNew->y = (swpClient.y + swpClient.cy) - (dheight - 2);312 dheight += ((dheight) * DriveLines); 313 pswpNew->y = (swpClient.y + swpClient.cy) - (dheight); 314 314 if (fToolbar) 315 315 pswpNew->y -= theight; 316 316 pswpNew->cx = swpClient.cx - 4; 317 pswpNew->cy = dheight - 4;317 pswpNew->cy = dheight; 318 318 pswpClient->cy -= dheight; 319 319 pswpClient->cy -= 2; -
trunk/dll/misc.c
r1410 r1438 845 845 else 846 846 ealen = sizeof(FEALIST) + 9; 847 rc = DosAllocMem((PPVOID) & pfealist, ealen + 64,848 OBJ_TILE | PAG_COMMIT | PAG_READ | PAG_WRITE);847 rc = xDosAllocMem((PPVOID) & pfealist, ealen + 64, 848 OBJ_TILE | PAG_COMMIT | PAG_READ | PAG_WRITE); 849 849 if (rc) 850 850 Dos_Error(MB_CANCEL, rc, HWND_DESKTOP, pszSrcFile, -
trunk/dll/mkdir.c
r1402 r1438 13 13 19 Jul 08 GKY Replace save_dir2(dir) with pFM2SaveDirectory 14 14 25 Dec 08 GKY Add code to allow write verify to be turned off on a per drive basis 15 28 Jun 09 GKY Added AddBackslashToPath() to remove repeatative code. 15 16 16 17 ***********************************************************************/ … … 40 41 #include "dirs.h" // save_dir2 41 42 #include "input.h" // InputDlgProc 43 #include "pathutil.h" // AddBackslashToPath 42 44 43 45 // Data definitions … … 185 187 strcpy(szBuff, pFM2SaveDirectory); 186 188 MakeValidDir(szBuff); 187 if (*szBuff && szBuff[strlen(szBuff) - 1] != '\\') 188 strcat(szBuff, "\\"); 189 AddBackslashToPath(szBuff); 190 //if (*szBuff && szBuff[strlen(szBuff) - 1] != '\\') 191 // strcat(szBuff, "\\"); 189 192 sip.prompt = GetPString(IDS_MKDIRPROMPTTEXT); 190 193 sip.inputlen = CCHMAXPATH - 1; … … 257 260 "%s%s%s%s", 258 261 GetPString(IDS_TARGETDIRTITLETEXT), 259 (*targetdir) ? "": "<",262 (*targetdir) ? NullStr : "<", 260 263 (*targetdir) ? 261 targetdir : GetPString(IDS_NONE), (*targetdir) ? "": ">");264 targetdir : GetPString(IDS_NONE), (*targetdir) ? NullStr : ">"); 262 265 else 263 266 *temp = 0; -
trunk/dll/mle.c
r1402 r1438 180 180 if (len) { 181 181 len++; 182 rc = DosAllocMem((PVOID) & temp, 4096,183 PAG_COMMIT | OBJ_TILE | PAG_READ | PAG_WRITE);182 rc = xDosAllocMem((PVOID) & temp, 4096, 183 PAG_COMMIT | OBJ_TILE | PAG_READ | PAG_WRITE); 184 184 if (rc || !temp) 185 185 Dos_Error(MB_CANCEL, rc, h, pszSrcFile, __LINE__, … … 263 263 if (!sel) 264 264 return FALSE; 265 rc = DosAllocMem((PVOID) & temp, 32768L,266 265 rc = xDosAllocMem((PVOID) & temp, 32768L, 266 PAG_COMMIT | OBJ_TILE | PAG_READ | PAG_WRITE); 267 267 if (rc || !temp) { 268 268 Dos_Error(MB_CANCEL, rc, h, pszSrcFile, __LINE__, … … 535 535 DosChgFilePtr(handle, 0, FILE_BEGIN, &action); 536 536 if (len) { 537 rc = DosAllocMem((PVOID) & hexbuff, 50001,538 PAG_COMMIT | OBJ_TILE | PAG_READ | PAG_WRITE);537 rc = xDosAllocMem((PVOID) & hexbuff, 50001, 538 PAG_COMMIT | OBJ_TILE | PAG_READ | PAG_WRITE); 539 539 if (rc || !hexbuff) { 540 540 Dos_Error(MB_CANCEL, rc, h, pszSrcFile, __LINE__, … … 664 664 fseek(fp, 0L, SEEK_SET); 665 665 if (len && len != -1) { 666 rc = DosAllocMem((PVOID) & buffer,667 50000L, PAG_COMMIT | OBJ_TILE | PAG_READ | PAG_WRITE);666 rc = xDosAllocMem((PVOID) & buffer, 667 50000L, PAG_COMMIT | OBJ_TILE | PAG_READ | PAG_WRITE); 668 668 if (rc || !buffer) { 669 669 Dos_Error(MB_CANCEL, rc, h, pszSrcFile, __LINE__, … … 916 916 } 917 917 918 rc = DosAllocMem((PVOID) & buffer, 4096L,919 PAG_COMMIT | OBJ_TILE | PAG_READ | PAG_WRITE);918 rc = xDosAllocMem((PVOID) & buffer, 4096L, 919 PAG_COMMIT | OBJ_TILE | PAG_READ | PAG_WRITE); 920 920 if (rc || !buffer) { 921 921 Dos_Error(MB_CANCEL, rc, h, pszSrcFile, __LINE__, -
trunk/dll/objcnr.c
r1402 r1438 24 24 10 Dec 08 SHL Integrate exception handler support 25 25 08 Mar 09 GKY Additional strings move to PCSZs 26 28 Jun 09 GKY Added AddBackslashToPath() to remove repeatative code. 26 27 27 28 ***********************************************************************/ … … 56 57 #include "fortify.h" 57 58 #include "excputil.h" // xbeginthread 59 #include "pathutil.h" // AddBackslashToPath 58 60 59 61 typedef struct … … 100 102 return; // Error already reported 101 103 strcpy(maskstr, filename); 102 if (maskstr[strlen(maskstr) - 1] != '\\') 103 strcat(maskstr, "\\"); 104 AddBackslashToPath(maskstr); 105 //if (maskstr[strlen(maskstr) - 1] != '\\') 106 // strcat(maskstr, "\\"); 104 107 endpath = &maskstr[strlen(maskstr)]; 105 108 strcat(maskstr, "*"); -
trunk/dll/pathutil.c
r1402 r1438 40 40 41 41 static PSZ pszSrcFile = __FILE__; 42 43 PSZ AddBackslashToPath(PSZ pszPathName) 44 { 45 if (pszPathName[strlen(pszPathName) - 1] != '\\') 46 strcat(pszPathName, PCSZ_BACKSLASH); 47 return pszPathName; 48 } 42 49 43 50 // #pragma data_seg(DATA1) -
trunk/dll/pathutil.h
r1398 r1438 11 11 05 Jan 08 SHL Move from fm3dll.h to here 12 12 29 Feb 08 GKY Changes to enable user settable command line length 13 28 Jun 09 GKY Added AddBackslashToPath() to remove repeatative code. 13 14 14 15 ***********************************************************************/ … … 22 23 #endif 23 24 25 PSZ AddBackslashToPath(PSZ pszPathName); 24 26 PSZ BldFullPathName(PSZ pszFullPathName, PCSZ pszPathName, PCSZ pszFileName); 25 27 PSZ BldQuotedFullPathName(PSZ pszFullPathName, PCSZ pszPathName, PCSZ pszFileName); -
trunk/dll/saveclip.c
r1402 r1438 100 100 if (clip) 101 101 len += strlen(clip) + 1; 102 if (! DosAllocSharedMem((PPVOID) &hold, (PSZ) NULL, len, PAG_COMMIT |102 if (!xDosAllocSharedMem((PPVOID) &hold, (PSZ) NULL, len, PAG_COMMIT | 103 103 OBJ_GIVEABLE | PAG_READ | PAG_WRITE)) { 104 104 *hold = 0; … … 169 169 } 170 170 if (WinOpenClipbrd(hab)) { 171 if (! DosAllocSharedMem((PPVOID) &text, (PSZ) NULL, len, PAG_COMMIT |172 OBJ_GIVEABLE | PAG_READ | PAG_WRITE)) {171 if (!xDosAllocSharedMem((PPVOID) &text, (PSZ) NULL, len, PAG_COMMIT | 172 OBJ_GIVEABLE | PAG_READ | PAG_WRITE)) { 173 173 *text = 0; 174 174 if (clip && clip[0]) { … … 242 242 { 243 243 HWND hwndCnr; 244 CHAR savename[CCHMAXPATH] = "", pattern[81]; 244 CHAR savename[CCHMAXPATH] = ""; 245 CHAR pattern[81]; 245 246 246 247 switch (msg) { … … 602 603 603 604 CHAR **list; 604 CHAR savename[CCHMAXPATH] = "", pattern[81]; 605 CHAR savename[CCHMAXPATH] = ""; 606 CHAR pattern[81]; 605 607 606 608 switch (msg) { -
trunk/dll/seeall.c
r1433 r1438 48 48 08 Mar 09 GKY Additional strings move to PCSZs in init.c 49 49 08 Mar 09 GKY Removed variable aurguments from docopyf and unlinkf (not used) 50 28 Jun 09 GKY Added AddBackslashToPath() to remove repeatative code. 50 51 51 52 ***********************************************************************/ … … 647 648 GetPString(IDS_MOVEDTEXT) : GetPString(IDS_COPIEDTEXT); 648 649 if (*path) { 649 strcpy(newname, path); 650 if (newname[strlen(newname) - 1] != '\\') 651 strcat(newname, "\\"); 650 strcpy(newname, path); 651 AddBackslashToPath(newname); 652 //if (newname[strlen(newname) - 1] != '\\') 653 // strcat(newname, "\\"); 652 654 if (plen) 653 655 p = list[x] + plen; … … 1058 1060 (*list[x] && 1059 1061 list[x][strlen(list[x]) - 1] != 1060 '\\') ? "\\": NullStr);1062 '\\') ? PCSZ_BACKSLASH : NullStr); 1061 1063 DosError(FERR_DISABLEHARDERR); 1062 1064 if (!error) -
trunk/dll/shadow.c
r1402 r1438 71 71 sprintf(s, 72 72 "EXENAME=%s%s%s%s%s;PARAMETERS=%%*;OBJECTID=<FM2_%s>", 73 (path) ? path : "",74 (path) ? "\\" : "",73 (path) ? path : NullStr, 74 (path) ? PCSZ_BACKSLASH : NullStr, 75 75 objtitle, 76 (path) ? ";STARTUPDIR=" : "", (path) ? path : "", objtitle);76 (path) ? ";STARTUPDIR=" : NullStr, (path) ? path : NullStr, objtitle); 77 77 WinSetObjectData(obj, s); 78 78 free(s); … … 112 112 "%s%s%sOBJECTID=<FM2_%s>", 113 113 objtitle, 114 (p == type[1]) ? "ICONFILE=" : "",115 (p == type[1]) ? s : "", (p == type[1]) ? ";" : "", objtitle);114 (p == type[1]) ? "ICONFILE=" : NullStr, 115 (p == type[1]) ? s : NullStr, (p == type[1]) ? ";" : NullStr, objtitle); 116 116 WinSetObjectData(obj, s2); 117 117 } … … 150 150 sprintf(s, 151 151 "SHADOWID=%s%s%s", 152 (path) ? path : "", (path) ? "\\" : "", objtitle);152 (path) ? path : NullStr, (path) ? PCSZ_BACKSLASH : NullStr, objtitle); 153 153 { /* find an icon for it if possible */ 154 154 CHAR *p, temp[CCHMAXPATH + 1]; … … 166 166 sprintf(&s[strlen(s)], 167 167 ";EXENAME=%s%s%s%s%s;PARAMETERS=%%*", 168 (path) ? path : "",169 (path) ? "\\" : "",170 objtitle, (path) ? ";STARTUPDIR=" : "", (path) ? path : "");168 (path) ? path : NullStr, 169 (path) ? PCSZ_BACKSLASH : NullStr, 170 objtitle, (path) ? ";STARTUPDIR=" : NullStr, (path) ? path : NullStr); 171 171 strcat(s, ";NODELETE=NO;TEMPLATE=NO;NOCOPY=NO;NOMOVE=NO"); 172 172 sprintf(&s[strlen(s)], ";OBJECTID=<FM2_%s>", objtitle); -
trunk/dll/srchpath.c
r1398 r1438 133 133 134 134 if (!filename) 135 return "";135 return NullStr; 136 136 found = searchapath(PCSZ_PATH, filename); 137 137 if (!*found) { -
trunk/dll/subj.c
r1402 r1438 125 125 else 126 126 ealen = sizeof(FEALIST) + 9; 127 rc = DosAllocMem((PPVOID) & pfealist, ealen + 1L,128 OBJ_TILE | PAG_COMMIT | PAG_READ | PAG_WRITE);127 rc = xDosAllocMem((PPVOID) & pfealist, ealen + 1L, 128 OBJ_TILE | PAG_COMMIT | PAG_READ | PAG_WRITE); 129 129 if (rc) 130 130 Dos_Error(MB_CANCEL, rc, hwnd, pszSrcFile, __LINE__, -
trunk/dll/systemf.c
r1402 r1438 201 201 strcpy(listfile, pTmpDir ? pTmpDir : pFM2SaveDirectory); 202 202 MakeTempName(listfile, "$FM2LI$T", 2); 203 /*if (listfile[strlen(listfile) - 1] != '\\')204 strcat(listfile, "\\");205 sprintf(&listfile[strlen(listfile)], "%s.%03x",206 LISTTEMPROOT, (clock() & 4095));*/207 203 fp = xfopen(listfile, "w",pszSrcFile,__LINE__); 208 204 if (fp) { … … 670 666 PID sessPID; 671 667 BOOL wasquote; 672 char *pszPgm, *pszArgs = NULL; 673 char szObject[32] = "", *p, szSavedir[CCHMAXPATH]; 668 char *p, *pszPgm, *pszArgs = NULL; 669 char szObject[32] = ""; 670 char szSavedir[CCHMAXPATH]; 674 671 BOOL useTermQ = FALSE; 675 672 char szTempdir[CCHMAXPATH]; … … 704 701 hwnd = HWND_DESKTOP; 705 702 706 rc = DosAllocMem((PVOID)&pszPgm,707 MaxComLineStrg,708 PAG_COMMIT | OBJ_TILE | PAG_READ | PAG_WRITE);703 rc = xDosAllocMem((PVOID)&pszPgm, 704 MaxComLineStrg, 705 PAG_COMMIT | OBJ_TILE | PAG_READ | PAG_WRITE); 709 706 if (rc) { 710 707 Dos_Error(MB_CANCEL,rc,hwnd,pszSrcFile,__LINE__,GetPString(IDS_OUTOFMEMORY)); … … 752 749 temp = *p; 753 750 if (temp) { 754 rc = DosAllocMem((PVOID)&pszArgs,755 MaxComLineStrg * 2,756 PAG_COMMIT | OBJ_TILE | PAG_READ | PAG_WRITE);751 rc = xDosAllocMem((PVOID)&pszArgs, 752 MaxComLineStrg * 2, 753 PAG_COMMIT | OBJ_TILE | PAG_READ | PAG_WRITE); 757 754 if (rc) 758 755 Dos_Error(MB_CANCEL,rc,hwnd,pszSrcFile,__LINE__,GetPString(IDS_OUTOFMEMORY)); … … 886 883 if (~type & FULLSCREEN) 887 884 type |= WINDOWED; 888 rc = DosAllocMem((PVOID) & pszArgs, MaxComLineStrg * 2,889 PAG_COMMIT | OBJ_TILE | PAG_READ | PAG_WRITE);885 rc = xDosAllocMem((PVOID) & pszArgs, MaxComLineStrg * 2, 886 PAG_COMMIT | OBJ_TILE | PAG_READ | PAG_WRITE); 890 887 if (rc) { 891 888 Dos_Error(MB_CANCEL,rc,hwnd,pszSrcFile,__LINE__,GetPString(IDS_OUTOFMEMORY)); -
trunk/dll/treecnr.c
r1434 r1438 799 799 if (CheckDrive(toupper(*pci->pszFileName), FileSystem, &type) == -1 || 800 800 fShowFSTypeInTree) 801 strcpy(FileSystem, "");801 strcpy(FileSystem, NullStr); 802 802 if (fShowDriveLabelInTree) 803 strcpy(szTmpLabel, "");803 strcpy(szTmpLabel, NullStr); 804 804 else 805 805 strcpy(szTmpLabel, volser.volumelabel); -
trunk/dll/undel.c
r1402 r1438 19 19 08 Mar 09 GKY Removed variable aurguments from docopyf and unlinkf (not used) 20 20 08 Mar 09 GKY Additional strings move to PCSZs 21 28 Jun 09 GKY Added AddBackslashToPath() to remove repeatative code. 21 22 22 23 ***********************************************************************/ … … 208 209 209 210 strcpy(s, (CHAR *)mp2); 210 if (s[strlen(s) - 1] != '\\') 211 strcat(s, "\\"); 211 AddBackslashToPath(s); 212 //if (s[strlen(s) - 1] != '\\') 213 // strcat(s, "\\"); 212 214 strcat(s, "*"); 213 215 WinSetDlgItemText(hwnd, UNDEL_ENTRY, s); -
trunk/dll/uudecode.c
r1398 r1438 43 43 #include "misc.h" // PaintRecessedWindow 44 44 #include "wrappers.h" // xfgets 45 #include "init.h" // Strings 45 46 46 47 static PSZ pszSrcFile = __FILE__; … … 98 99 } 99 100 else 100 strcat(build, "\\");101 strcat(build, PCSZ_BACKSLASH); 101 102 strncat(build, dest, CCHMAXPATH - strlen(dest)); 102 103 strcpy(dest, build); -
trunk/dll/valid.c
r1402 r1438 57 57 #include "strips.h" // bstrip 58 58 #include "init.h" // GetTidForWindow 59 #include "wrappers.h" // xDosAllocMem 59 60 60 61 … … 295 296 296 297 # define BUFFER_BYTES 8192 297 rc = DosAllocMem(&pvBuffer, BUFFER_BYTES,298 PAG_COMMIT | OBJ_TILE | PAG_READ | PAG_WRITE);298 rc = xDosAllocMem(&pvBuffer, BUFFER_BYTES, 299 PAG_COMMIT | OBJ_TILE | PAG_READ | PAG_WRITE); 299 300 if (rc) { 300 301 Dos_Error(MB_CANCEL, rc, HWND_DESKTOP, pszSrcFile, __LINE__, -
trunk/dll/viewinf.c
r1400 r1438 20 20 07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook. 21 21 08 Mar 09 GKY Additional strings move to PCSZs in init.c 22 28 Jun 09 GKY Added AddBackslashToPath() to remove repeatative code. 22 23 23 24 ***********************************************************************/ … … 121 122 122 123 strcpy(mask, p); 123 if (mask[strlen(mask) - 1] != '\\') 124 strcat(mask, "\\"); 124 AddBackslashToPath(mask); 125 //if (mask[strlen(mask) - 1] != '\\') 126 // strcat(mask, "\\"); 125 127 enddir = mask + strlen(mask); 126 128 if (dummy->help) -
trunk/dll/walkem.c
r1402 r1438 34 34 19 Jul 08 GKY Replace save_dir2(dir) with pFM2SaveDirectory and use BldFullPathName 35 35 24 Aug 08 GKY Warn full drive on save of .DAT file; prevent loss of existing file 36 28 Jun 09 GKY Added AddBackslashToPath() to remove repeatative code. 36 37 37 38 ***********************************************************************/ … … 681 682 sprintf(szTemp, 682 683 "%s%s*", 683 pszPath, (pszPath[strlen(pszPath) - 1] == '\\') ? "" : "\\");684 pszPath, (pszPath[strlen(pszPath) - 1] == '\\') ? NullStr : PCSZ_BACKSLASH); 684 685 DosError(FERR_DISABLEHARDERR); 685 686 if (!DosFindFirst(szTemp, … … 1146 1147 bstrip(szBuffer); 1147 1148 if (*szBuffer) { 1148 strcpy(szBuff, wa->szCurrentPath); 1149 if (szBuff[strlen(szBuff) - 1] != '\\') 1150 strcat(szBuff, "\\"); 1149 strcpy(szBuff, wa->szCurrentPath); 1150 AddBackslashToPath(szBuff); 1151 //if (szBuff[strlen(szBuff) - 1] != '\\') 1152 // strcat(szBuff, "\\"); 1151 1153 strcat(szBuff, szBuffer); 1152 1154 MakeFullName(szBuff); … … 1539 1541 bstrip(szBuffer); 1540 1542 if (*szBuffer) { 1541 strcpy(szBuff, wa->szCurrentPath1); 1542 if (szBuff[strlen(szBuff) - 1] != '\\') 1543 strcat(szBuff, "\\"); 1543 strcpy(szBuff, wa->szCurrentPath1); 1544 AddBackslashToPath(szBuff); 1545 //if (szBuff[strlen(szBuff) - 1] != '\\') 1546 // strcat(szBuff, "\\"); 1544 1547 strcat(szBuff, szBuffer); 1545 1548 MakeFullName(szBuff); … … 1604 1607 bstrip(szBuffer); 1605 1608 if (*szBuffer) { 1606 strcpy(szBuff, wa->szCurrentPath2); 1607 if (szBuff[strlen(szBuff) - 1] != '\\') 1608 strcat(szBuff, "\\"); 1609 strcpy(szBuff, wa->szCurrentPath2); 1610 AddBackslashToPath(szBuff); 1611 //if (szBuff[strlen(szBuff) - 1] != '\\') 1612 // strcat(szBuff, "\\"); 1609 1613 strcat(szBuff, szBuffer); 1610 1614 MakeFullName(szBuff); -
trunk/dll/worker.c
r1402 r1438 41 41 08 Mar 09 GKY Removed variable aurguments from docopyf and unlinkf (not used) 42 42 08 Mar 09 GKY Additional strings move to PCSZs 43 28 Jun 09 GKY Added AddBackslashToPath() to remove repeatative code. 43 44 44 45 ***********************************************************************/ … … 230 231 } 231 232 else 232 strcat(wk->li->targetpath, "\\");233 strcat(wk->li->targetpath, PCSZ_BACKSLASH); 233 234 sprintf(wk->li->targetpath + strlen(wk->li->targetpath), 234 235 "MERGE.%03x", (clock() & 4095L)); … … 708 709 GetPString(IDS_MOVEDTEXT) : GetPString(IDS_COPIEDTEXT); 709 710 if (*wk->li->targetpath) { 710 strcpy(newname, wk->li->targetpath); 711 if (newname[strlen(newname) - 1] != '\\') 712 strcat(newname, "\\"); 711 strcpy(newname, wk->li->targetpath); 712 AddBackslashToPath(newname); 713 //if (newname[strlen(newname) - 1] != '\\') 714 // strcat(newname, "\\"); 713 715 if (plen) 714 716 p = wk->li->list[x] + plen; … … 1209 1211 if (wk->li->type == IDM_MCIPLAY) 1210 1212 break; 1211 strcpy(szBuffer, wk->li->targetpath); 1212 if (wk->li->targetpath[strlen(wk->li->targetpath) - 1] != '\\') 1213 strcat(szBuffer, "\\"); 1213 strcpy(szBuffer, wk->li->targetpath); 1214 AddBackslashToPath(wk->li->targetpath); 1215 //if (wk->li->targetpath[strlen(wk->li->targetpath) - 1] != '\\') 1216 // strcat(szBuffer, "\\"); 1214 1217 p = szBuffer + strlen(szBuffer); 1215 1218 for (x = 0; wk->li->list[x]; x++) { … … 1270 1273 } 1271 1274 else { 1272 if (*wk->li->targetpath && !IsFile(wk->li->targetpath)) 1273 if (wk->li->targetpath[strlen(wk->li->targetpath) - 1] != 1274 '\\') 1275 strcat(wk->li->targetpath, "\\"); 1275 if (*wk->li->targetpath && !IsFile(wk->li->targetpath)) 1276 AddBackslashToPath(wk->li->targetpath); 1277 //if (wk->li->targetpath[strlen(wk->li->targetpath) - 1] != 1278 // '\\') 1279 // strcat(wk->li->targetpath, "\\"); 1276 1280 ad.namecanchange = 1; 1277 1281 } … … 1298 1302 break; 1299 1303 if (!*wk->li->targetpath && *wk->directory) { 1300 strcpy(ad.arcname, wk->directory); 1301 if (ad.arcname[strlen(ad.arcname) - 1] != '\\') 1302 strcat(ad.arcname, "\\"); 1304 strcpy(ad.arcname, wk->directory); 1305 AddBackslashToPath(ad.arcname); 1306 //if (ad.arcname[strlen(ad.arcname) - 1] != '\\') 1307 // strcat(ad.arcname, "\\"); 1303 1308 } 1304 1309 if (!WinDlgBox(HWND_DESKTOP, wk->hwndFrame, ArchiveDlgProc, FM3ModHandle, … … 1636 1641 wk->li-> 1637 1642 list[x][strlen(wk->li->list[x]) - 1] 1638 != '\\') ? "\\": NullStr);1643 != '\\') ? PCSZ_BACKSLASH : NullStr); 1639 1644 DosError(FERR_DISABLEHARDERR); 1640 1645 if (!error) -
trunk/dll/wrappers.c
r1432 r1438 51 51 #pragma data_seg(GLOBAL1) 52 52 BOOL fNoLargeFileSupport; 53 54 APIRET xDosAllocSharedMem(PPVOID ppb, 55 PSZ pszName, 56 ULONG cb, 57 ULONG flag) 58 { 59 APIRET rc; ; 60 61 rc = DosAllocSharedMem(ppb, pszName, cb, flag | OBJ_ANY); 62 DbgMsg(pszSrcFile, __LINE__, "ppb %p", *ppb); 63 if (rc) 64 rc = DosAllocSharedMem(ppb, pszName, cb, flag); 65 return rc; 66 } 67 68 APIRET xDosAllocMem(PPVOID ppb, 69 ULONG cb, 70 ULONG flag) 71 { 72 APIRET rc; 73 74 rc = DosAllocMem(ppb, cb, flag | OBJ_ANY); 75 DbgMsg(pszSrcFile, __LINE__, "ppb %p %x", *ppb, rc); 76 if (rc) 77 rc = DosAllocMem(ppb, cb, flag); 78 DbgMsg(pszSrcFile, __LINE__, "ppb %p", *ppb); 79 return rc; 80 } 53 81 54 82 APIRET xDosFindFirst(PSZ pszFileSpec, -
trunk/dll/wrappers.h
r1327 r1438 19 19 #include <os2.h> 20 20 #endif 21 22 APIRET xDosAllocSharedMem(PPVOID ppb, 23 PSZ pszName, 24 ULONG cb, 25 ULONG flag); 26 27 APIRET xDosAllocMem(PPVOID ppb, 28 ULONG cb, 29 ULONG flag); 21 30 22 31 APIRET xDosFindFirst(PSZ pszFileSpec,
Note:
See TracChangeset
for help on using the changeset viewer.