Changeset 920 for trunk/dll/notebook.c


Ignore:
Timestamp:
Jan 13, 2008, 2:18:17 AM (18 years ago)
Author:
Gregg Young
Message:

Cleanup of NormalizeCmdLine moved to pathutil.c

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/notebook.c

    r919 r920  
    2121  21 Aug 07 GKY Make Subject column in dircnr sizable and movable from the rigth to the left pane
    2222  26 Nov 07 GKY Allow a currently nonvalid path in the ext path field with warning
    23   06 Jan 08 GKY Use CheckApp_QuoteAddExe to check program strings on entry
     23  06 Jan 08 GKY Use NormalizeCmdLine to check program strings on entry
    2424  10 Jan 08 SHL Remember last settings page
    2525  10 Jan 08 SHL Rework page select logic
     
    194194    {
    195195      CHAR szCLBuf[MAXCOMLINESTRG], szPathBuf[CCHMAXPATH];
    196       PSZ psz;
    197 
    198       psz = xmalloc(MAXCOMLINESTRG, pszSrcFile, __LINE__);
     196      PSZ pszWorkBuf;
     197
     198      pszWorkBuf = xmalloc(MAXCOMLINESTRG, pszSrcFile, __LINE__);
    199199      WinQueryDlgItemText(hwnd, CFGA_VIRUS, MAXCOMLINESTRG, szCLBuf);
    200200      szCLBuf[MAXCOMLINESTRG - 1] = 0;
    201201      if (strcmp(szCLBuf, virus)){
    202         CheckApp_QuoteAddExe(psz, szCLBuf);
    203         memcpy(virus, psz, strlen(psz) + 1);
     202        NormalizeCmdLine(pszWorkBuf, szCLBuf);
     203        memcpy(virus, pszWorkBuf, strlen(pszWorkBuf) + 1);
    204204        if (!strchr(virus, '%') && strlen(virus) > 3)
    205205          strcat(virus, " %p");
     
    458458    {
    459459      CHAR szCLBuf[MAXCOMLINESTRG];
    460       PSZ psz;
    461 
    462       psz = xmalloc(MAXCOMLINESTRG, pszSrcFile, __LINE__);
     460      PSZ pszWorkBuf;
     461
     462      pszWorkBuf = xmalloc(MAXCOMLINESTRG, pszSrcFile, __LINE__);
    463463      WinQueryDlgItemText(hwnd, CFGV_VIEWER, MAXCOMLINESTRG, szCLBuf);
    464464      szCLBuf[MAXCOMLINESTRG - 1] = 0;
    465465      if (strcmp(szCLBuf, viewer)){
    466         CheckApp_QuoteAddExe(psz, szCLBuf);
    467         memcpy(viewer, psz, strlen(psz) + 1);
     466        NormalizeCmdLine(pszWorkBuf, szCLBuf);
     467        memcpy(viewer, pszWorkBuf, strlen(pszWorkBuf) + 1);
    468468        if (!strchr(viewer, '%') && strlen(viewer) > 3)
    469469          strcat(viewer, " %a");
     
    472472      szCLBuf[MAXCOMLINESTRG - 1] = 0;
    473473      if (strcmp(szCLBuf, editor)){
    474         CheckApp_QuoteAddExe(psz, szCLBuf);
    475         memcpy(editor, psz, strlen(psz) + 1);
     474        NormalizeCmdLine(pszWorkBuf, szCLBuf);
     475        memcpy(editor, pszWorkBuf, strlen(pszWorkBuf) + 1);
    476476        if (!strchr(editor, '%') && strlen(editor) > 3)
    477477          strcat(editor, " %a");
     
    480480      szCLBuf[MAXCOMLINESTRG - 1] = 0;
    481481      if (strcmp(szCLBuf, binview)){
    482         CheckApp_QuoteAddExe(psz, szCLBuf);
    483         memcpy(binview, psz, strlen(psz) + 1);
     482        NormalizeCmdLine(pszWorkBuf, szCLBuf);
     483        memcpy(binview, pszWorkBuf, strlen(pszWorkBuf) + 1);
    484484        if (!strchr(binview, '%') && strlen(binview) > 3)
    485485          strcat(binview, " %a");
     
    488488      szCLBuf[MAXCOMLINESTRG - 1] = 0;
    489489      if (strcmp(szCLBuf, bined)){
    490         CheckApp_QuoteAddExe(psz, szCLBuf);
    491         memcpy(bined, psz, strlen(psz) + 1);
     490        NormalizeCmdLine(pszWorkBuf, szCLBuf);
     491        memcpy(bined, pszWorkBuf, strlen(pszWorkBuf) + 1);
    492492        if (!strchr(bined, '%') && strlen(bined) > 3)
    493493          strcat(bined, " %a");
     
    652652      // they contain args.
    653653      CHAR szCLBuf[MAXCOMLINESTRG], szPathBuf[CCHMAXPATH];
    654       PSZ  psz;
    655 
    656       psz = xmalloc(MAXCOMLINESTRG, pszSrcFile, __LINE__);
     654      PSZ  pszWorkBuf;
     655
     656      pszWorkBuf = xmalloc(MAXCOMLINESTRG, pszSrcFile, __LINE__);
    657657      WinQueryDlgItemText(hwnd, CFGH_RUNHTTPWORKDIR, CCHMAXPATH, szPathBuf);
    658658      szPathBuf[CCHMAXPATH - 1] = 0;
     
    670670      szCLBuf[MAXCOMLINESTRG - 1] = 0;
    671671      if (strcmp(szCLBuf, ftprun)){
    672         CheckApp_QuoteAddExe(psz, szCLBuf);
    673         memcpy(ftprun, psz, strlen(psz) + 1);
     672        NormalizeCmdLine(pszWorkBuf, szCLBuf);
     673        memcpy(ftprun, pszWorkBuf, strlen(pszWorkBuf) + 1);
    674674      }
    675675      WinQueryDlgItemText(hwnd, CFGH_HTTPRUN, MAXCOMLINESTRG, szCLBuf);
    676676      szCLBuf[MAXCOMLINESTRG - 1] = 0;
    677677      if (strcmp(szCLBuf, httprun)){
    678         CheckApp_QuoteAddExe(psz, szCLBuf);
    679         memcpy(httprun, psz, strlen(psz) + 1);
     678        NormalizeCmdLine(pszWorkBuf, szCLBuf);
     679        memcpy(httprun, pszWorkBuf, strlen(pszWorkBuf) + 1);
    680680      }
    681681      WinQueryDlgItemText(hwnd, CFGH_MAILRUN, MAXCOMLINESTRG, szCLBuf);
    682682      szCLBuf[MAXCOMLINESTRG - 1] = 0;
    683683      if (strcmp(szCLBuf, mailrun)){
    684         CheckApp_QuoteAddExe(psz, szCLBuf);
    685         memcpy(mailrun, psz, strlen(psz) + 1);
     684        NormalizeCmdLine(pszWorkBuf, szCLBuf);
     685        memcpy(mailrun, pszWorkBuf, strlen(pszWorkBuf) + 1);
    686686      }
    687687      PrfWriteProfileString(fmprof, appname, "HttpRunDir", httprundir);
     
    12631263    {
    12641264      CHAR szCLBuf[MAXCOMLINESTRG];
    1265       PSZ psz;
    1266 
    1267       psz = xmalloc(MAXCOMLINESTRG, pszSrcFile, __LINE__);
     1265      PSZ pszWorkBuf;
     1266
     1267      pszWorkBuf = xmalloc(MAXCOMLINESTRG, pszSrcFile, __LINE__);
    12681268      WinQueryDlgItemText(hwnd, CFGC_DIRCOMPARE, MAXCOMLINESTRG, szCLBuf);
    12691269        szCLBuf[MAXCOMLINESTRG - 1] = 0;
    12701270        if (strcmp(szCLBuf, dircompare)){
    1271           CheckApp_QuoteAddExe(psz, szCLBuf);
    1272           memcpy(dircompare, psz, strlen(psz) + 1);
     1271          NormalizeCmdLine(pszWorkBuf, szCLBuf);
     1272          memcpy(dircompare, pszWorkBuf, strlen(pszWorkBuf) + 1);
    12731273          if (!strchr(dircompare, '%') && strlen(dircompare) > 3)
    12741274            strcat(dircompare, " %a");
     
    12781278        szCLBuf[MAXCOMLINESTRG - 1] = 0;
    12791279        if (strcmp(szCLBuf, compare)){
    1280           CheckApp_QuoteAddExe(psz, szCLBuf);
    1281           memcpy(compare, psz, strlen(psz) + 1);
     1280          NormalizeCmdLine(pszWorkBuf, szCLBuf);
     1281          memcpy(compare, pszWorkBuf, strlen(pszWorkBuf) + 1);
    12821282          if (!strchr(compare, '%') && strlen(compare) > 3)
    12831283            strcat(compare, " %a");
Note: See TracChangeset for help on using the changeset viewer.