Changeset 909 for trunk/dll/systemf.c


Ignore:
Timestamp:
Jan 6, 2008, 9:02:31 PM (18 years ago)
Author:
Gregg Young
Message:

Added quoting code to commands, associations and avv; Minor clean up and fixed one problem with quoting logic; Added warning re %a for commands to work on selected files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/systemf.c

    r907 r909  
    13091309PSZ CheckApp_QuoteAddExe(PSZ pszPgm)
    13101310{
    1311   char szTempPgm[CCHMAXPATH], tempcom[CCHMAXPATH], temparg[CCHMAXPATH];
    1312   char *offset, *offsetexe, *offsetcom, *offsetcmd, *offsetbtm, *offsetbat;
     1311  char szTempPgm[2048], tempcom[2048], temparg[2048];
     1312  char *offset = '\0', *offsetexe, *offsetcom, *offsetcmd, *offsetbtm, *offsetbat;
    13131313  APIRET ret;
    13141314  ULONG ulAppType;
     
    13281328    offsetbtm = strstr(strlwr(pszPgm), ".btm");
    13291329    offsetbat = strstr(strlwr(pszPgm), ".bat");
    1330     if (offsetbat){
    1331       if (strstr(strlwr(pszPgm), "command ") < offsetbat)
    1332         offset = pszPgm;
    1333       else
    1334         offset = offsetbat;
    1335     }
    1336     else if (offsetbtm){
    1337       if (strstr(strlwr(pszPgm), "4os2 ") < offsetbtm)
    1338         offset = pszPgm;
    1339       else
    1340         offset = offsetbtm;
    1341     }
    1342     else if (offsetcmd){
    1343       if (strstr(strlwr(pszPgm), "cmd ") < offsetcmd ||
    1344           strstr(strlwr(pszPgm), "4os2 ") < offsetcmd)
    1345         offset = pszPgm;
    1346       else
    1347         offset = offsetcmd;
    1348     }
    1349     else if (offsetcom)
    1350       offset = offsetcom;
    1351     else if (offsetexe)
     1330    if (offsetexe)
    13521331      offset = offsetexe;
    1353     else {
    1354       offset = pszPgm;
    1355     }
    1356     if (offset - pszPgm != 0){
     1332    else{
     1333      if (offsetcom)
     1334        offset = offsetcom;
     1335      else{
     1336        if (offsetcmd)
     1337          offset = offsetcmd;
     1338        else{
     1339          if (offsetbtm)
     1340            offset = offsetbtm;
     1341          else{
     1342            if (offsetbat)
     1343              offset = offsetexe;
     1344          }
     1345        }
     1346      }
     1347    }
     1348    if (offset){
    13571349      tempcom[offset + 4 - pszPgm] = '\0';
    13581350      strcpy(temparg, &pszPgm[offset + 4 - pszPgm]);
Note: See TracChangeset for help on using the changeset viewer.