Changeset 909 for trunk/dll/assoc.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/assoc.c

    r907 r909  
    630630      {
    631631        ASSOC temp;
    632         CHAR dummy[34];
     632        CHAR dummy[34], *psz[1002];
    633633
    634634        replace = FALSE;
     
    645645        memset(&temp, 0, sizeof(ASSOC));
    646646        WinQueryDlgItemText(hwnd, ASS_MASK, sizeof(temp.mask), temp.mask);
    647         WinQueryDlgItemText(hwnd, ASS_CL, sizeof(temp.cl), temp.cl);
     647        WinQueryDlgItemText(hwnd, ASS_CL, sizeof(temp.cl), temp.cl);
     648        *psz = CheckApp_QuoteAddExe(temp.cl);
     649        memcpy(temp.cl, *psz, strlen(*psz) + 1);
    648650        WinQueryDlgItemText(hwnd, ASS_SIG, sizeof(temp.sig), temp.sig);
    649651        rstrip(temp.sig);
     
    669671          temp.flags |= DIEAFTER;
    670672        if (WinQueryButtonCheckstate(hwnd, ASS_PROMPT))
    671           temp.flags |= PROMPT;
     673          temp.flags |= PROMPT;
     674        if (fCancelAction){
     675          fCancelAction = FALSE;
     676          break;
     677        }
     678        else
    672679        info = add_association(&temp);
    673680        if (!info)
     
    719726      {
    720727        ASSOC temp;
    721         CHAR dummy[34];
     728        CHAR dummy[34], *psz[1002];
    722729
    723730        replace = FALSE;
     
    725732        memset(&temp, 0, sizeof(ASSOC));
    726733        WinQueryDlgItemText(hwnd, ASS_MASK, sizeof(temp.mask), temp.mask);
    727         WinQueryDlgItemText(hwnd, ASS_CL, sizeof(temp.cl), temp.cl);
     734        WinQueryDlgItemText(hwnd, ASS_CL, sizeof(temp.cl), temp.cl);
     735        *psz = CheckApp_QuoteAddExe(temp.cl);
     736        memcpy(temp.cl, *psz, strlen(*psz) + 1);
    728737        WinQueryDlgItemText(hwnd, ASS_SIG, sizeof(temp.sig), temp.sig);
    729738        rstrip(temp.sig);
     
    749758          temp.flags |= DIEAFTER;
    750759        if (WinQueryButtonCheckstate(hwnd, ASS_PROMPT))
    751           temp.flags |= PROMPT;
    752         info = add_association(&temp);
     760          temp.flags |= PROMPT;
     761        if (fCancelAction){
     762          fCancelAction = FALSE;
     763          break;
     764        }
     765        else
     766          info = add_association(&temp);
    753767        //Add will fail if mask is not changed
    754768        if (info) {
     
    821835      {
    822836        ASSOC temp;
    823         CHAR dummy[34];
     837        CHAR dummy[34], *psz[1002];
    824838
    825839        replace = TRUE;
     
    831845        memset(&temp, 0, sizeof(ASSOC));
    832846        WinQueryDlgItemText(hwnd, ASS_MASK, sizeof(temp.mask), temp.mask);
    833         WinQueryDlgItemText(hwnd, ASS_CL, sizeof(temp.cl), temp.cl);
     847        WinQueryDlgItemText(hwnd, ASS_CL, sizeof(temp.cl), temp.cl);
     848        *psz = CheckApp_QuoteAddExe(temp.cl);
     849        memcpy(temp.cl, *psz, strlen(*psz) + 1);
    834850        WinQueryDlgItemText(hwnd, ASS_SIG, sizeof(temp.sig), temp.sig);
    835851        rstrip(temp.sig);
     
    855871          temp.flags |= DIEAFTER;
    856872        if (WinQueryButtonCheckstate(hwnd, ASS_PROMPT))
    857           temp.flags |= PROMPT;
    858         info = add_association(&temp);
     873          temp.flags |= PROMPT;
     874        if (fCancelAction){
     875          fCancelAction = FALSE;
     876          break;
     877        }
     878        else
     879          info = add_association(&temp);
    859880        //Add will fail if mask is not changed
    860881        if (info) {
Note: See TracChangeset for help on using the changeset viewer.