Changeset 906
- Timestamp:
- Jan 6, 2008, 5:21:14 AM (18 years ago)
- Location:
- trunk/dll
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/arccnrs.c
r897 r906 1700 1700 for (x = 0; li->list[x]; x++) { 1701 1701 BldFullPathName(fullname, li->targetpath, li->list[x]); 1702 // sprintf(fullname, "%s%s%s",1703 // li->targetpath,1704 // (li->targetpath[strlen(li->targetpath) - 1] == '\\') ?1705 // NullStr : "\\", li->list[x]);1706 1702 if (IsFile(fullname) != -1) { 1707 1703 AddToList(li->list[x], &exfiles, &numfiles, &numalloc); … … 1861 1857 } 1862 1858 BldFullPathName(cl, li->targetpath, li->list[x]); 1863 // sprintf(cl, "%s%s%s", li->targetpath,1864 // (li->targetpath[strlen(li->targetpath) - 1] == '\\') ?1865 // NullStr : "\\", li->list[x]);1866 1859 temp = li->list[x]; 1867 1860 li->list[x] = xstrdup(cl, pszSrcFile, __LINE__); … … 2684 2677 case IDM_NOTEBOOK: 2685 2678 if (!ParentIsDesktop(dcd->hwndParent, dcd->hwndParent)) 2686 2687 2679 PostMsg(dcd->hwndParent, msg, mp1, mp2); 2680 else 2688 2681 WinDlgBox(HWND_DESKTOP, 2689 2682 hwnd, 2690 CfgDlgProc, FM3ModHandle, CFG_FRAME, (PVOID) "Archive");2683 CfgDlgProc, FM3ModHandle, CFG_FRAME, MPFROMP("Archive")); 2691 2684 break; 2692 2685 … … 2956 2949 for (x = 0; li->list && li->list[x]; x++) { 2957 2950 BldFullPathName(s, dcd->workdir, li->list[x]); 2958 // sprintf(s, "%s%s%s", dcd->workdir,2959 // (dcd->workdir[strlen(dcd->workdir) - 1] == '\\') ?2960 // NullStr : "\\", li->list[x]);2961 2951 if (IsFile(s) != 1) { 2962 2952 free(li->list[x]); -
trunk/dll/avv.c
r888 r906 52 52 static PSZ nonull(PSZ a); 53 53 static PSZ free_and_strdup_from_window(HWND hwnd, USHORT id, PSZ pszDest); 54 static PSZ free_and_strdup_quoted_from_window(HWND hwnd, USHORT id, PSZ pszDest); 54 55 55 56 //=== EditArchiverDefinition() Select archiver to edit definition === … … 85 86 if (*sz) 86 87 pszDest = xstrdup(sz, pszSrcFile, __LINE__); 88 else 89 pszDest = NULL; 90 return pszDest; 91 } 92 93 static PSZ free_and_strdup_quoted_from_window(HWND hwnd, USHORT id, PSZ pszDest) 94 { 95 CHAR sz[256], *psz[256]; 96 97 xfree(pszDest); 98 WinQueryDlgItemText(hwnd, id, sizeof(sz), sz); 99 if (*sz){ 100 *psz = CheckApp_QuoteAddExe(sz); 101 pszDest = xstrdup(sz, pszSrcFile, __LINE__); 102 } 87 103 else 88 104 pszDest = NULL; … … 816 832 free_and_strdup_from_window(hwnd, AD_ID, admp->info->id); 817 833 admp->info->create = 818 free_and_strdup_ from_window(hwnd, AD_ADD, admp->info->create);834 free_and_strdup_quoted_from_window(hwnd, AD_ADD, admp->info->create); 819 835 admp->info->createwdirs = 820 free_and_strdup_ from_window(hwnd, AD_ADDWPATHS,836 free_and_strdup_quoted_from_window(hwnd, AD_ADDWPATHS, 821 837 admp->info->createwdirs); 822 838 admp->info->createrecurse = 823 free_and_strdup_ from_window(hwnd, AD_ADDRECURSE,839 free_and_strdup_quoted_from_window(hwnd, AD_ADDRECURSE, 824 840 admp->info->createrecurse); 825 841 admp->info->movewdirs = 826 free_and_strdup_ from_window(hwnd, AD_MOVEWPATHS,842 free_and_strdup_quoted_from_window(hwnd, AD_MOVEWPATHS, 827 843 admp->info->movewdirs); 828 844 admp->info->move = 829 free_and_strdup_ from_window(hwnd, AD_MOVE, admp->info->move);845 free_and_strdup_quoted_from_window(hwnd, AD_MOVE, admp->info->move); 830 846 admp->info->delete = 831 free_and_strdup_ from_window(hwnd, AD_DELETE, admp->info->delete);847 free_and_strdup_quoted_from_window(hwnd, AD_DELETE, admp->info->delete); 832 848 admp->info->test = 833 free_and_strdup_ from_window(hwnd, AD_TEST, admp->info->test);849 free_and_strdup_quoted_from_window(hwnd, AD_TEST, admp->info->test); 834 850 admp->info->extract = 835 free_and_strdup_ from_window(hwnd, AD_EXTRACT, admp->info->extract);851 free_and_strdup_quoted_from_window(hwnd, AD_EXTRACT, admp->info->extract); 836 852 admp->info->exwdirs = 837 free_and_strdup_ from_window(hwnd, AD_WDIRS, admp->info->exwdirs);853 free_and_strdup_quoted_from_window(hwnd, AD_WDIRS, admp->info->exwdirs); 838 854 admp->info->ext = 839 855 free_and_strdup_from_window(hwnd, AD_EXT, admp->info->ext); … … 841 857 free_and_strdup_from_window(hwnd, AD_SIG, admp->info->signature); 842 858 admp->info->siglen = literal(admp->info->signature); 843 admp->info->list = free_and_strdup_ from_window(hwnd,859 admp->info->list = free_and_strdup_quoted_from_window(hwnd, 844 860 AD_LIST, 845 861 admp->info->list); -
trunk/dll/collect.c
r888 r906 1527 1527 else 1528 1528 WinDlgBox(HWND_DESKTOP, hwnd, CfgDlgProc, FM3ModHandle, 1529 CFG_FRAME, (PVOID) "Collector");1529 CFG_FRAME, MPFROMP("Collector")); 1530 1530 break; 1531 1531 -
trunk/dll/fm3dll.h
r902 r906 740 740 char *RootName(char *filename); 741 741 APIRET MakeFullName(char *filename); 742 PSZ CheckApp_QuoteAddExe(PSZ pszPgm); 742 743 743 744 /* misc.c */ … … 867 868 void strip_trail_char(char *pszStripChars, char *pszSrc); 868 869 VOID remove_first_occurence_of_character(char *pszRemoveChar, char *pszSrc); 870 VOID remove_last_occurence_of_character(char *pszRemoveChar, char *pszSrc); 869 871 870 872 #define lstrip(s) strip_lead_char(" \t",(s)) … … 1446 1448 fSubjectLengthMax, fNoLargeFileSupport, fNoMailtoMailRun, 1447 1449 fHttpRunWPSDefault, fFtpRunWPSDefault, fLibPathStrictMailRun, 1448 fLibPathStrictHttpRun, fLibPathStrictFtpRun ;1450 fLibPathStrictHttpRun, fLibPathStrictFtpRun, fCancelAction; 1449 1451 DATADEF BOOL detailsladate, detailslatime, detailscrdate, detailscrtime, 1450 1452 detailslongname, detailsea, detailssize, detailssubject, -
trunk/dll/fm3dll.str
r897 r906 295 295 The FM/2 INI file \"%s\" can not be marked read/write. 296 296 FM/2: Help 297 298 299 300 301 297 The program "%s" not found.\nAre the Path and Filename correct?\nDo you wish to save it anyway? 298 "%s" doesn't appear to be executable.\nDo you wish to save it anyway? 299 "%s" isn't an exe file and has no extension.\nFM2 requires an extension for executing a program 300 "%s" doesn't appear to be executable. It doesn't have a standard executable file extension\nDo you wish to save it anyway? 301 "%s" has quoting in the program arguments which may or may not be correct. 302 302 303 303 FM/2: See all files … … 658 658 Can't find this file. 659 659 Must be run through command processor (i.e. "CMD.EXE /C ...") 660 OS/2 says: Nota directly executable type.660 OS/2 says: Doesn't appear to be a directly executable type. 661 661 Acceptable apptype 662 662 DOS -
trunk/dll/fm3str.h
r892 r906 301 301 #define IDS_INIREADONLYTEXT 294 302 302 #define IDS_FM2HELPTITLETEXT 295 303 #define IDS_PROGRAMNOTFOUNDTEXT 296 304 #define IDS_PROGRAMNOTEXETEXT 297 305 #define IDS_PROGRAMNOTEXE2TEXT 298 306 #define IDS_PROGRAMNOTEXE3TEXT 299 307 #define IDS_QUOTESINARGSTEXT 300 303 308 #define IDS_SEEALLTITLETEXT 302 304 309 #define IDS_UNTITLEDTEXT 303 -
trunk/dll/newview.c
r898 r906 145 145 CHAR *pszCharCounter; 146 146 CHAR *pszTestStr = pszSrc; 147 CHAR szMailTo[1024] = " <mailto:";148 CHAR szMailEnd[] = ">";147 CHAR szMailTo[1024] = "mailto:"; 148 //CHAR szMailEnd[] = ">"; 149 149 150 150 if (!strnstr(pszTestStr, pszFindChar, StrLens)) … … 158 158 strip_trail_char(">", pszSrc); 159 159 strcat(szMailTo, pszSrc); 160 strcat(szMailTo, szMailEnd);160 // strcat(szMailTo, szMailEnd); 161 161 pszSrc = szMailTo; 162 162 return pszSrc; … … 185 185 strip_trail_char(">", pszSrc); 186 186 strcat(szMailTo, pszSrc); 187 strcat(szMailTo, szMailEnd);187 //strcat(szMailTo, szMailEnd); 188 188 pszSrc = szMailTo; 189 189 return pszSrc; -
trunk/dll/notebook.c
r898 r906 198 198 PrfWriteProfileString(fmprof, appname, "DefArc", szDefArc); 199 199 { 200 CHAR szBuf[CCHMAXPATH], buf[10] = "\"%-/";200 CHAR szBuf[CCHMAXPATH], *psz; 201 201 202 202 WinQueryDlgItemText(hwnd, CFGA_VIRUS, CCHMAXPATH, szBuf); 203 203 szBuf[CCHMAXPATH - 1] = 0; 204 if (strcmp(szBuf, virus)){ 205 psz = CheckApp_QuoteAddExe(szBuf); 206 memcpy(virus, psz, strlen(psz) + 1); 207 if (!strchr(virus, '%') && strlen(virus) > 3) 208 strcat(virus, " %p"); 209 } 210 if (!*virus) 211 strcpy(virus, "OS2SCAN.EXE %p /SUB /A"); 212 WinQueryDlgItemText(hwnd, CFGA_EXTRACTPATH, CCHMAXPATH, szBuf); 213 szBuf[CCHMAXPATH - 1] = 0; 204 214 bstrip(szBuf); 205 if (!strcspn(szBuf, buf)) 206 BldQuotedFileName(virus, szBuf); 207 else 208 memcpy(virus, szBuf, strlen(szBuf) + 1); 209 if (!strchr(virus, '%') && strlen(virus) > 3) 210 strcat(virus, " %p"); 211 } 212 if (!*virus) 213 strcpy(virus, "OS2SCAN.EXE %p /SUB /A"); 214 WinQueryDlgItemText(hwnd, CFGA_EXTRACTPATH, CCHMAXPATH, extractpath); 215 extractpath[CCHMAXPATH - 1] = 0; 216 bstrip(extractpath); 217 if (*extractpath) { 218 if (strcmp(extractpath, "*")) { 219 220 MakeFullName(extractpath); 221 if (IsFile(extractpath)) { 222 ulResult = saymsg(MB_YESNOCANCEL | MB_ICONQUESTION | MB_DEFBUTTON1, HWND_DESKTOP, 223 GetPString(IDS_WARNINGTEXT), 224 GetPString(IDS_EXTPATHNOTVALIDTEXT), 225 extractpath); 226 if (ulResult == MBID_YES) 227 *extractpath = 0; 228 if (ulResult == MBID_CANCEL){ 229 WinDlgBox(HWND_DESKTOP, 230 hwnd, CfgDlgProc, 231 FM3ModHandle, CFG_FRAME, 232 (PVOID) "Archive"); 233 break; 215 216 if (strcmp(extractpath, szBuf)) { 217 memcpy(extractpath, szBuf, strlen(szBuf) + 1); 218 if (*extractpath){ 219 MakeFullName(extractpath); 220 if (IsFile(extractpath)) { 221 ulResult = saymsg(MB_YESNOCANCEL | MB_ICONQUESTION | MB_DEFBUTTON1, HWND_DESKTOP, 222 GetPString(IDS_WARNINGTEXT), 223 GetPString(IDS_EXTPATHNOTVALIDTEXT), 224 extractpath); 225 if (ulResult == MBID_YES) 226 *extractpath = 0; 227 if (ulResult == MBID_CANCEL){ 228 WinDlgBox(HWND_DESKTOP, 229 hwnd, CfgDlgProc, 230 FM3ModHandle, CFG_FRAME, 231 MPFROMP("Archive")); 232 break; 233 } 234 234 } 235 235 } 236 236 } 237 237 } … … 239 239 PrfWriteProfileString(fmprof, appname, "ExtractPath", extractpath); 240 240 break; 241 } 242 if (fCancelAction){ 243 fCancelAction = FALSE; 244 WinDlgBox(HWND_DESKTOP, 245 hwnd, CfgDlgProc, FM3ModHandle, CFG_FRAME, MPFROMP("Archive")); 241 246 } 242 247 return WinDefDlgProc(hwnd, msg, mp1, mp2); … … 450 455 case WM_CLOSE: 451 456 { 452 CHAR szBuf[CCHMAXPATH], buf[10] = "\"%-/";457 CHAR szBuf[CCHMAXPATH], *psz; 453 458 454 459 WinQueryDlgItemText(hwnd, CFGV_VIEWER, CCHMAXPATH, szBuf); 455 460 szBuf[CCHMAXPATH - 1] = 0; 456 bstrip(szBuf); 457 if (!strcspn(szBuf, buf)) 458 BldQuotedFileName(viewer, szBuf); 459 else 460 memcpy(viewer, szBuf, strlen(szBuf) + 1); 461 if (!strchr(viewer, '%') && strlen(viewer) > 3) 462 strcat(viewer, " %a"); 461 if (strcmp(szBuf, viewer)){ 462 psz = CheckApp_QuoteAddExe(szBuf); 463 memcpy(viewer, psz, strlen(psz) + 1); 464 if (!strchr(viewer, '%') && strlen(viewer) > 3) 465 strcat(viewer, " %a"); 466 } 463 467 WinQueryDlgItemText(hwnd, CFGV_EDITOR, CCHMAXPATH, szBuf); 464 468 szBuf[CCHMAXPATH - 1] = 0; 465 bstrip(szBuf); 466 if (!strcspn(szBuf, buf)) 467 BldQuotedFileName(editor, szBuf); 468 else 469 memcpy(editor, szBuf, strlen(szBuf) + 1); 470 if (!strchr(editor, '%') && strlen(editor) > 3) 471 strcat(editor, " %a"); 469 if (strcmp(szBuf, editor)){ 470 psz = CheckApp_QuoteAddExe(szBuf); 471 memcpy(editor, psz, strlen(psz) + 1); 472 if (!strchr(editor, '%') && strlen(editor) > 3) 473 strcat(editor, " %a"); 474 } 472 475 WinQueryDlgItemText(hwnd, CFGV_BINVIEW, CCHMAXPATH, szBuf); 473 476 szBuf[CCHMAXPATH - 1] = 0; 474 bstrip(szBuf); 475 if (!strcspn(szBuf, buf)) 476 BldQuotedFileName(binview, szBuf); 477 else 478 memcpy(binview, szBuf, strlen(szBuf) + 1); 479 if (!strchr(binview, '%') && strlen(binview) > 3) 480 strcat(binview, " %a"); 477 if (strcmp(szBuf, binview)){ 478 psz = CheckApp_QuoteAddExe(szBuf); 479 memcpy(binview, psz, strlen(psz) + 1); 480 if (!strchr(binview, '%') && strlen(binview) > 3) 481 strcat(binview, " %a"); 482 } 481 483 WinQueryDlgItemText(hwnd, CFGV_BINED, CCHMAXPATH, szBuf); 482 484 szBuf[CCHMAXPATH - 1] = 0; 483 bstrip(szBuf); 484 if (!strcspn(szBuf, buf)) 485 BldQuotedFileName(bined, szBuf); 486 else 487 memcpy(bined, szBuf, strlen(szBuf) + 1); 488 if (!strchr(bined, '%') && strlen(bined) > 3) 489 strcat(bined, " %a"); 490 else 491 memcpy(bined, szBuf, strlen(szBuf) + 1); 485 if (strcmp(szBuf, bined)){ 486 psz = CheckApp_QuoteAddExe(szBuf); 487 memcpy(bined, psz, strlen(psz) + 1); 488 if (!strchr(bined, '%') && strlen(bined) > 3) 489 strcat(bined, " %a"); 490 } 492 491 PrfWriteProfileString(fmprof, appname, "Viewer", viewer); 493 492 PrfWriteProfileString(fmprof, appname, "Editor", editor); … … 508 507 break; 509 508 } 509 } 510 if (fCancelAction){ 511 fCancelAction = FALSE; 512 WinDlgBox(HWND_DESKTOP, 513 hwnd, CfgDlgProc, FM3ModHandle, CFG_FRAME, MPFROMP("Viewer1")); 510 514 } 511 515 return WinDefDlgProc(hwnd, msg, mp1, mp2); … … 637 641 638 642 case WM_CLOSE: 639 { 640 CHAR szBuf[CCHMAXPATH], buf[10] = "\"%-/"; 643 { // fixme these strings can be longer than CCHMAXPATH since 644 // they contain args. 645 CHAR szBuf[CCHMAXPATH], *psz; 641 646 642 647 WinQueryDlgItemText(hwnd, CFGH_RUNHTTPWORKDIR, CCHMAXPATH, szBuf); 643 648 szBuf[CCHMAXPATH - 1] = 0; 644 649 bstrip(szBuf); 645 if (!strcspn(szBuf, buf)) 646 BldQuotedFileName(httprundir, szBuf); 647 else 648 memcpy(httprundir, szBuf, strlen(szBuf) + 1); 650 memcpy(httprundir, szBuf, strlen(szBuf) + 1); 649 651 WinQueryDlgItemText(hwnd, CFGH_RUNFTPWORKDIR, CCHMAXPATH, szBuf); 650 652 szBuf[CCHMAXPATH - 1] = 0; 651 653 bstrip(szBuf); 652 if (!strcspn(szBuf, buf)) 653 BldQuotedFileName(ftprundir, szBuf); 654 else 655 memcpy(ftprundir, szBuf, strlen(szBuf) + 1); 654 memcpy(ftprundir, szBuf, strlen(szBuf) + 1); 656 655 WinQueryDlgItemText(hwnd, CFGH_RUNMAILWORKDIR, CCHMAXPATH, szBuf); 657 656 szBuf[CCHMAXPATH - 1] = 0; 658 657 bstrip(szBuf); 659 if (!strcspn(szBuf, buf)) 660 BldQuotedFileName(mailrundir, szBuf); 661 else 662 memcpy(mailrundir, szBuf, strlen(szBuf) + 1); 658 memcpy(mailrundir, szBuf, strlen(szBuf) + 1); 663 659 WinQueryDlgItemText(hwnd, CFGH_FTPRUN, CCHMAXPATH, szBuf); 664 660 szBuf[CCHMAXPATH - 1] = 0; 665 bstrip(szBuf); 666 if (!strchr(szBuf, '"')) 667 BldQuotedFileName(ftprun, szBuf); 668 else 669 memcpy(ftprun, szBuf, strlen(szBuf) + 1); 661 if (strcmp(szBuf, ftprun)){ 662 psz = CheckApp_QuoteAddExe(szBuf); 663 memcpy(ftprun, psz, strlen(psz) + 1); 664 } 670 665 WinQueryDlgItemText(hwnd, CFGH_HTTPRUN, CCHMAXPATH, szBuf); 671 666 szBuf[CCHMAXPATH - 1] = 0; 672 bstrip(szBuf); 673 if (!strchr(szBuf, '"')) 674 BldQuotedFileName(httprun, szBuf); 675 else 676 memcpy(httprun, szBuf, strlen(szBuf) + 1); 667 if (strcmp(szBuf, httprun)){ 668 psz = CheckApp_QuoteAddExe(szBuf); 669 memcpy(httprun, psz, strlen(psz) + 1); 670 } 677 671 WinQueryDlgItemText(hwnd, CFGH_MAILRUN, CCHMAXPATH, szBuf); 678 672 szBuf[CCHMAXPATH - 1] = 0; 679 bstrip(szBuf); 680 if (!strcspn(szBuf, buf)) 681 BldQuotedFileName(mailrun, szBuf); 682 else 683 memcpy(mailrun, szBuf, strlen(szBuf) + 1); 673 if (strcmp(szBuf, mailrun)){ 674 psz = CheckApp_QuoteAddExe(szBuf); 675 memcpy(mailrun, psz, strlen(psz) + 1); 676 } 684 677 PrfWriteProfileString(fmprof, appname, "HttpRunDir", httprundir); 685 678 PrfWriteProfileString(fmprof, appname, "FtpRunDir", ftprundir); … … 708 701 break; 709 702 } 703 } 704 if (fCancelAction){ 705 fCancelAction = FALSE; 706 WinDlgBox(HWND_DESKTOP, 707 hwnd, CfgDlgProc, FM3ModHandle, CFG_FRAME, MPFROMP("Viewer2")); 710 708 } 711 709 return WinDefDlgProc(hwnd, msg, mp1, mp2); … … 1249 1247 case WM_CLOSE: 1250 1248 { 1251 CHAR szBuf[CCHMAXPATH], buf[10] = "\"%-/";1249 CHAR szBuf[CCHMAXPATH], *psz; 1252 1250 1253 1251 WinQueryDlgItemText(hwnd, CFGC_DIRCOMPARE, CCHMAXPATH, szBuf); 1254 1252 szBuf[CCHMAXPATH - 1] = 0; 1255 bstrip(szBuf); 1256 if (!strcspn(szBuf, buf)) 1257 BldQuotedFileName(dircompare, szBuf); 1258 else 1259 memcpy(dircompare, szBuf, strlen(szBuf) + 1); 1260 if (!strchr(dircompare, '%') && strlen(dircompare) > 3) 1261 strcat(dircompare, " %a"); 1253 if (strcmp(szBuf, dircompare)){ 1254 psz = CheckApp_QuoteAddExe(szBuf); 1255 memcpy(dircompare, psz, strlen(psz) + 1); 1256 if (!strchr(dircompare, '%') && strlen(dircompare) > 3) 1257 strcat(dircompare, " %a"); 1258 } 1262 1259 PrfWriteProfileString(fmprof, appname, "DirCompare", dircompare); 1263 1260 WinQueryDlgItemText(hwnd, CFGC_COMPARE, CCHMAXPATH, szBuf); 1264 1261 szBuf[CCHMAXPATH - 1] = 0; 1265 bstrip(szBuf); 1266 if (!strcspn(szBuf, buf)) 1267 BldQuotedFileName(compare, szBuf); 1268 else 1269 memcpy(compare, szBuf, strlen(szBuf) + 1); 1270 if (!strchr(compare, '%') && strlen(compare) > 3) 1271 strcat(compare, " %a"); 1262 if (strcmp(szBuf, compare)){ 1263 psz = CheckApp_QuoteAddExe(szBuf); 1264 memcpy(compare, psz, strlen(psz) + 1); 1265 if (!strchr(compare, '%') && strlen(compare) > 3) 1266 strcat(compare, " %a"); 1267 } 1272 1268 PrfWriteProfileString(fmprof, appname, "Compare", compare); 1273 1269 break; 1274 1270 } 1271 } 1272 if (fCancelAction){ 1273 fCancelAction = FALSE; 1274 WinDlgBox(HWND_DESKTOP, 1275 hwnd, CfgDlgProc, FM3ModHandle, CFG_FRAME, MPFROMP("Compare")); 1275 1276 } 1276 1277 return WinDefDlgProc(hwnd, msg, mp1, mp2); … … 3111 3112 } 3112 3113 } 3114 if (mp2 && !strcmp((CHAR *) mp2, "Viewer2")) 3115 PostMsg(WinWindowFromID(hwnd, CFG_NOTEBOOK), 3116 BKM_TURNTOPAGE, MPFROMLONG(np[9].pageID), MPVOID); 3117 else if (mp2 && !strcmp((CHAR *) mp2, "Viewer1")) 3118 PostMsg(WinWindowFromID(hwnd, CFG_NOTEBOOK), 3119 BKM_TURNTOPAGE, MPFROMLONG(np[8].pageID), MPVOID); 3120 else if (mp2 && !strcmp((CHAR *) mp2, "Compare")) 3121 PostMsg(WinWindowFromID(hwnd, CFG_NOTEBOOK), 3122 BKM_TURNTOPAGE, MPFROMLONG(np[10].pageID), MPVOID); 3123 else if (mp2 && !strcmp((CHAR *) mp2, "Archive")) 3124 PostMsg(WinWindowFromID(hwnd, CFG_NOTEBOOK), 3125 BKM_TURNTOPAGE, MPFROMLONG(np[5].pageID), MPVOID); 3126 else if (mp2 && !strcmp((CHAR *) mp2, "Tree")) 3127 PostMsg(WinWindowFromID(hwnd, CFG_NOTEBOOK), 3128 BKM_TURNTOPAGE, MPFROMLONG(np[6].pageID), MPVOID); 3129 else if (mp2 && !strcmp((CHAR *) mp2, "Collector")) 3130 PostMsg(WinWindowFromID(hwnd, CFG_NOTEBOOK), 3131 BKM_TURNTOPAGE, MPFROMLONG(np[3].pageID), MPVOID); 3113 3132 /* see if we've been asked to display quick cfg page */ 3114 if (!mp2 || 3115 strcmp((CHAR *) mp2, "First Time") || 3116 !x || !np[x - 1].hwnd || !np[x - 1].pageID) { 3117 PostMsg(WinWindowFromID(hwnd, CFG_NOTEBOOK), 3118 BKM_TURNTOPAGE, MPFROMLONG(np[0].pageID), MPVOID); 3119 } 3133 else if (!mp2 || strcmp((CHAR *) mp2, "First Time") || 3134 !x || !np[x - 1].hwnd || !np[x - 1].pageID) 3135 PostMsg(WinWindowFromID(hwnd, CFG_NOTEBOOK), 3136 BKM_TURNTOPAGE, MPFROMLONG(np[0].pageID), MPVOID); 3120 3137 else { 3121 3138 PostMsg(MainObjectHwnd, UM_SETDIR, MPFROMLONG(1L), MPVOID); 3122 3139 PostMsg(WinWindowFromID(hwnd, CFG_NOTEBOOK), 3123 3140 BKM_TURNTOPAGE, MPFROMLONG(np[x - 1].pageID), MPVOID); 3124 3141 PostMsg(hwnd, UM_FOCUSME, MPFROMLONG(np[x - 1].hwnd), MPVOID); 3125 3142 PostMsg(np[x - 1].hwnd, WM_COMMAND, MPFROM2SHORT(IDM_HELP, 0), MPVOID); 3126 3143 } 3127 break; 3144 3145 break; 3128 3146 3129 3147 case UM_FOCUSME: -
trunk/dll/strips.c
r895 r906 81 81 } 82 82 83 VOID remove_last_occurence_of_character(char *pszRemoveChar, char *pszSrc) 84 { 85 PSZ pszStrLocation; 86 87 pszStrLocation = strrchr(pszSrc, *pszRemoveChar); 88 if (pszStrLocation) 89 memmove(pszStrLocation, pszStrLocation + 1, strlen(pszStrLocation) + 1); 90 } 91 83 92 #pragma alloc_text(MISC8,chop_at_crnl,convert_nl_to_nul,strip_trail_char,strip_lead_char) -
trunk/dll/systemf.c
r893 r906 636 636 BOOL useTermQ = FALSE; 637 637 char szTempdir[CCHMAXPATH]; 638 //char szTempPgm[CCHMAXPATH], tempcom[2048], temparg[2048], buf[10] = " &|<>";639 //char *offset, *offsetexe, *offsetcom, *offsetcmd, *offsetbtm, *offsetbat;640 //UINT offsetquote;641 638 642 639 typedef struct { … … 685 682 parguments); 686 683 va_end(parguments); 687 /*offsetexe = strstr(strlwr(pszPgm), ".exe"); 688 offsetcmd = strstr(strlwr(pszPgm), ".cmd"); 689 offsetcom = strstr(strlwr(pszPgm), ".com"); 690 offsetbtm = strstr(strlwr(pszPgm), ".btm"); 691 offsetbat = strstr(strlwr(pszPgm), ".bat"); 692 if (offsetexe) 693 offset = offsetexe; 694 else if (offsetcom) 695 offset = offsetcom; 696 else if (offsetcmd) 697 offset = offsetcmd; 698 else if (offsetbtm) 699 offset = offsetbtm; 700 else if (offsetbat) 701 offset = offsetbat; 702 else { 703 offset = pszPgm; 704 } 705 offsetquote = strcspn(pszPgm, buf); 706 if (pszPgm[0] != '\"' && offsetquote < offset - pszPgm && offsetquote != NULL){ 707 strcpy(tempcom, pszPgm); 708 tempcom[offset + 4 - pszPgm] = '\0'; 709 strcpy (temparg, &pszPgm[offset + 4 - pszPgm]); 710 pszDirectory = szTempdir; 711 strcpy(pszDirectory, tempcom); 712 offset = strrchr(pszDirectory, '\\'); 713 pszDirectory[offset +1 - pszDirectory] = '\0'; 714 BldQuotedFileName(szTempPgm, tempcom); 715 strcat(szTempPgm, temparg); 716 memcpy(pszPgm, szTempPgm, 2048); 717 //printf("%s\n %s\n%s %s\n %d %d", 718 // pszPgm, szTempPgm, tempcom, temparg, offset, offsetquote); fflush(stdout); 719 } */ 684 720 685 if (pszEnvironment) { 721 686 p = &pszEnvironment[strlen(pszEnvironment)] + 1; … … 1343 1308 } 1344 1309 1310 PSZ CheckApp_QuoteAddExe(PSZ pszPgm) 1311 { 1312 char szTempPgm[CCHMAXPATH], tempcom[CCHMAXPATH], temparg[CCHMAXPATH]; 1313 char *offset, *offsetexe, *offsetcom, *offsetcmd, *offsetbtm, *offsetbat; 1314 APIRET ret; 1315 ULONG ulAppType; 1316 char *pszChar; 1317 FILEFINDBUF3 FindBuffer; 1318 ULONG ulResultBufLen = sizeof(FILEFINDBUF3); 1319 HDIR hdirFindHandle = HDIR_CREATE; 1320 ULONG ulFindCount = 1; 1321 PSZ pszQuotedCompletePgm; 1322 1323 bstrip(pszPgm); 1324 strcpy(tempcom, pszPgm); 1325 if (tempcom[0] != '\0'){ 1326 offsetexe = strstr(strlwr(pszPgm), ".exe"); 1327 offsetcmd = strstr(strlwr(pszPgm), ".cmd"); 1328 offsetcom = strstr(strlwr(pszPgm), ".com"); 1329 offsetbtm = strstr(strlwr(pszPgm), ".btm"); 1330 offsetbat = strstr(strlwr(pszPgm), ".bat"); 1331 if (offsetbat){ 1332 if (strstr(strlwr(pszPgm), "command ") < offsetbat) 1333 offset = pszPgm; 1334 else 1335 offset = offsetbat; 1336 } 1337 else if (offsetbtm){ 1338 if (strstr(strlwr(pszPgm), "4os2 ") < offsetbtm) 1339 offset = pszPgm; 1340 else 1341 offset = offsetbtm; 1342 } 1343 else if (offsetcmd){ 1344 if (strstr(strlwr(pszPgm), "cmd ") < offsetcmd || 1345 strstr(strlwr(pszPgm), "4os2 ") < offsetcmd) 1346 offset = pszPgm; 1347 else 1348 offset = offsetcmd; 1349 } 1350 else if (offsetcom) 1351 offset = offsetcom; 1352 else if (offsetexe) 1353 offset = offsetexe; 1354 else { 1355 offset = pszPgm; 1356 } 1357 if (offset - pszPgm != 0){ 1358 tempcom[offset + 4 - pszPgm] = '\0'; 1359 strcpy(temparg, &pszPgm[offset + 4 - pszPgm]); 1360 /*if ((offsetexe && !offsetcom && !offsetcmd && !offsetbtm && !offsetbat) || 1361 (offsetcom && !offsetexe && !offsetcmd && !offsetbtm && !offsetbat) || 1362 (offsetcmd && !offsetexe && !offsetcom && !offsetbtm && !offsetbat) || 1363 (offsetbtm && !offsetexe && !offsetcom && !offsetcmd && !offsetbat) || 1364 (offsetbat && !offsetexe && !offsetcom && !offsetcmd && !offsetbtm))*/ 1365 remove_first_occurence_of_character("\"", tempcom); 1366 if (strchr(tempcom, '\"') != strrchr(tempcom, '\"')) 1367 saymsg(MB_OK, HWND_DESKTOP, 1368 NullStr, 1369 GetPString(IDS_QUOTESINARGSTEXT), 1370 pszPgm); 1371 else 1372 remove_first_occurence_of_character("\"", tempcom); 1373 if ((temparg[0] == '\"' && temparg[1] == ' ') || 1374 !strstr(pszPgm, "\\:")|| 1375 strchr(temparg, '\"') == strrchr(temparg, '\"')) 1376 remove_first_occurence_of_character("\"", temparg); 1377 if (strchr(temparg, '\"') != strrchr(temparg, '\"')) 1378 saymsg(MB_OK, HWND_DESKTOP, 1379 NullStr, 1380 GetPString(IDS_QUOTESINARGSTEXT), 1381 pszPgm); 1382 if (!strstr(strlwr(tempcom), ".exe")) { 1383 ret = DosFindFirst(tempcom, &hdirFindHandle, FILE_NORMAL, &FindBuffer, 1384 ulResultBufLen, &ulFindCount, FIL_STANDARD); 1385 BldQuotedFileName(szTempPgm, tempcom); 1386 } 1387 else{ 1388 BldQuotedFileName(szTempPgm, tempcom); 1389 ret = DosQueryAppType(tempcom, &ulAppType); 1390 } 1391 //printf("%d A", ret); fflush(stdout); 1392 if (ret) { 1393 ret = saymsg(MB_YESNO, 1394 HWND_DESKTOP, 1395 NullStr, 1396 GetPString(IDS_PROGRAMNOTFOUNDTEXT), 1397 pszPgm); 1398 if (ret == MBID_YES){ 1399 if (temparg[0] != ' ') 1400 strcat(szTempPgm, " "); 1401 strcat(szTempPgm, temparg); 1402 pszQuotedCompletePgm = szTempPgm; 1403 } 1404 else{ 1405 fCancelAction = TRUE; 1406 pszQuotedCompletePgm = pszPgm; 1407 } 1408 } 1409 else{ 1410 if (temparg[0] != ' ') 1411 strcat(szTempPgm, " "); 1412 strcat(szTempPgm, temparg); 1413 pszQuotedCompletePgm = szTempPgm; 1414 } 1415 1416 } 1417 else if (tempcom && (!strchr(tempcom, '.') || 1418 strrchr(tempcom, '.' ) < strrchr(tempcom, '\\'))){ 1419 if (!strchr(tempcom, ' ')){ 1420 while (strchr(tempcom, '\"')) 1421 remove_first_occurence_of_character("\"", tempcom); 1422 strcat(tempcom, ".exe"); 1423 ret = DosFindFirst(tempcom, &hdirFindHandle, FILE_NORMAL, &FindBuffer, 1424 ulResultBufLen, &ulFindCount, FIL_STANDARD); 1425 //printf("%d", ret); fflush(stdout); 1426 } 1427 else{ 1428 pszChar = tempcom; 1429 while (pszChar){ 1430 while (strchr(tempcom, '\"')) 1431 remove_first_occurence_of_character("\"", tempcom); 1432 if (*pszChar == ' '){ 1433 *pszChar = '\0'; 1434 strcat(tempcom, ".exe"); 1435 ret = DosQueryAppType(tempcom, &ulAppType); 1436 //printf("%d %s\n", ret, tempcom); fflush(stdout); 1437 if (!ret){ 1438 break; 1439 } 1440 } 1441 strcpy(tempcom, pszPgm); 1442 pszChar++; 1443 } 1444 } 1445 if (!ret){ 1446 BldQuotedFileName(szTempPgm, tempcom); 1447 strcpy(temparg, pszPgm + strlen(tempcom) - 3); 1448 if ((temparg[0] == '\"' && temparg[1] == ' ') || 1449 !strstr(pszPgm, "\\:" ) || 1450 strchr(temparg, '\"') == strrchr(temparg, '\"')) 1451 remove_first_occurence_of_character("\"", temparg); 1452 if (strchr(temparg, '\"') != strrchr(temparg, '\"')) 1453 saymsg(MB_OK, HWND_DESKTOP, 1454 NullStr, 1455 GetPString(IDS_QUOTESINARGSTEXT), 1456 pszPgm); 1457 if (temparg[0] != ' ') 1458 strcat(szTempPgm, " "); 1459 strcat(szTempPgm, temparg); 1460 pszQuotedCompletePgm = szTempPgm; 1461 } 1462 else { 1463 ret = saymsg(MB_OK, 1464 HWND_DESKTOP, 1465 NullStr, 1466 GetPString(IDS_PROGRAMNOTEXE2TEXT), 1467 pszPgm); 1468 fCancelAction = TRUE; 1469 pszQuotedCompletePgm = pszPgm; 1470 } 1471 } 1472 else { 1473 pszChar = strrchr(tempcom, '.'); 1474 while (pszChar && *pszChar !=' '){ 1475 pszChar++; 1476 } 1477 *pszChar = '\0'; 1478 strcpy (temparg, pszPgm + strlen(tempcom)); 1479 while (strchr(tempcom, '\"')) 1480 remove_first_occurence_of_character("\"", tempcom); 1481 if ((temparg[0] == '\"' && temparg[1] == ' ') || 1482 !strstr(pszPgm, "\\:")|| 1483 strchr(temparg, '\"') == strrchr(temparg, '\"')) 1484 remove_first_occurence_of_character("\"", temparg); 1485 if (strchr(temparg, '\"') != strrchr(temparg, '\"')) 1486 saymsg(MB_OK, HWND_DESKTOP, 1487 NullStr, 1488 GetPString(IDS_QUOTESINARGSTEXT), 1489 pszPgm); 1490 ret = DosFindFirst(tempcom, &hdirFindHandle, FILE_NORMAL, &FindBuffer, 1491 ulResultBufLen, &ulFindCount, FIL_STANDARD); 1492 1493 BldQuotedFileName(szTempPgm, tempcom); 1494 //printf("%d %s ", ret, tempcom); fflush(stdout); 1495 if (ret) { 1496 ret = saymsg(MB_YESNO, 1497 HWND_DESKTOP, 1498 NullStr, 1499 GetPString(IDS_PROGRAMNOTFOUNDTEXT), 1500 pszPgm); 1501 if (ret == MBID_YES){ 1502 if (temparg[0] != ' ') 1503 strcat(szTempPgm, " "); 1504 strcat(szTempPgm, temparg); 1505 pszQuotedCompletePgm = szTempPgm; 1506 } 1507 else{ 1508 fCancelAction = TRUE; 1509 pszQuotedCompletePgm = pszPgm; 1510 } 1511 } 1512 ret = saymsg(MB_YESNO, 1513 HWND_DESKTOP, 1514 NullStr, 1515 GetPString(IDS_PROGRAMNOTEXE3TEXT), 1516 pszPgm); 1517 if (ret == MBID_YES){ 1518 if (temparg[0] != ' ') 1519 strcat(szTempPgm, " "); 1520 strcat(szTempPgm, temparg); 1521 pszQuotedCompletePgm = szTempPgm; 1522 } 1523 else{ 1524 fCancelAction = TRUE; 1525 pszQuotedCompletePgm = pszPgm; 1526 } 1527 } 1528 return pszQuotedCompletePgm; 1529 } 1530 return pszPgm; 1531 } 1532 1345 1533 #pragma alloc_text(SYSTEMF,ShowSession,ExecOnList,runemf2) -
trunk/dll/treecnr.c
r888 r906 2373 2373 2374 2374 case IDM_NOTEBOOK: 2375 if (!ParentIsDesktop(dcd->hwndParent, dcd->hwndParent))2376 PostMsg(dcd->hwndParent, msg, mp1, mp2);2377 else2375 //if (!ParentIsDesktop(dcd->hwndParent, dcd->hwndParent)) 2376 // PostMsg(dcd->hwndParent, msg, mp1, mp2); 2377 //else 2378 2378 WinDlgBox(HWND_DESKTOP, hwnd, CfgDlgProc, FM3ModHandle, 2379 CFG_FRAME, (PVOID) "Tree");2379 CFG_FRAME, MPFROMP("Tree")); 2380 2380 break; 2381 2381
Note:
See TracChangeset
for help on using the changeset viewer.