Changeset 1750 for trunk/dll/pathutil.c


Ignore:
Timestamp:
Mar 1, 2014, 2:55:57 PM (11 years ago)
Author:
John Small
Message:

Ticket #524: Made "searchapath" thread-safe. Function names and signatures were changed.

So calls to these functions, direct and indirect, had to be changed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/pathutil.c

    r1699 r1750  
    1919  23 Oct 10 GKY Add ForwardslashToBackslash function to streamline code
    2020  17 Sep 11 GKY Fix commandline quoting issues
     21  01 Mar 14 JBS Ticket #524: Made "searchapath" thread-safe. Function names and signatures were changed.
     22                So calls to these functions had to be changed.
    2123
    2224***********************************************************************/
     
    3335#include "init.h"                       // Data declaration(s)
    3436#include "fm3str.h"
    35 #include "srchpath.h"                   // searchapath
     37#include "srchpath.h"                   // Search*Path*ForFile
    3638#include "pathutil.h"
    3739#include "strips.h"                     // remove_first_occurence_of_character
     
    157159  ULONG ulAppType;
    158160  char *pszChar;
    159   char *FullPath;
    160161  PSZ pszNewCmdLine = pszWorkBuf;
    161162
     
    210211               pszCmdLine_);
    211212      if (!offsetexe && !offsetcom) {
    212         FullPath = searchapath(PCSZ_PATH, szCmdLine);
    213         if (*FullPath)
    214           ret = 0;
     213        if (!SearchPathForFile(PCSZ_PATH, szCmdLine, NULL))
     214          ret = 0;
    215215      }
    216216      else
     
    257257            *offset = 0;
    258258            strcat(szCmdLine, PCSZ_DOTCMD);
    259             FullPath = searchapath(PCSZ_PATH, szCmdLine);
    260             if (*FullPath)
     259            if (!SearchPathForFile(PCSZ_PATH, szCmdLine, NULL))
    261260              ret = 0;
    262261            else {
    263262              *offset = 0;
    264263              strcat(szCmdLine, PCSZ_DOTBAT);
    265               FullPath = searchapath(PCSZ_PATH, szCmdLine);
    266               if (*FullPath)
     264              if (!SearchPathForFile(PCSZ_PATH, szCmdLine, NULL))
    267265                ret = 0;
    268266              else {
    269267                *offset = 0;
    270268                strcat(szCmdLine, PCSZ_DOTBTM);
    271                 FullPath = searchapath(PCSZ_PATH, szCmdLine);
    272                 if (*FullPath)
     269                if (!SearchPathForFile(PCSZ_PATH, szCmdLine, NULL))
    273270                  ret = 0;
    274271              }
     
    296293                *offset = 0;
    297294                strcat(szCmdLine, PCSZ_DOTCMD);
    298                 FullPath = searchapath(PCSZ_PATH, szCmdLine);
    299                 if (*FullPath) {
     295                if (!SearchPathForFile(PCSZ_PATH, szCmdLine, NULL)) {
    300296                  ret = 0;
    301297                  break;
     
    304300                  *offset = 0;
    305301                  strcat(szCmdLine, PCSZ_DOTBAT);
    306                   FullPath = searchapath(PCSZ_PATH, szCmdLine);
    307                   if (*FullPath) {
     302                  if (!SearchPathForFile(PCSZ_PATH, szCmdLine, NULL)) {
    308303                    ret = 0;
    309304                    break;
     
    312307                    *offset = 0;
    313308                    strcat(szCmdLine, PCSZ_DOTBTM);
    314                     FullPath = searchapath(PCSZ_PATH, szCmdLine);
    315                     if (*FullPath) {
     309                    if (!SearchPathForFile(PCSZ_PATH, szCmdLine, NULL)) {
    316310                      ret = 0;
    317311                      break;
     
    372366             GetPString(IDS_QUOTESINARGSTEXT),
    373367             pszCmdLine_);
    374     FullPath = searchapath(PCSZ_PATH, szCmdLine);
    375368    BldQuotedFileName(pszNewCmdLine, szCmdLine);
    376     if (!*FullPath) {
     369    if (SearchPathForFile(PCSZ_PATH, szCmdLine, NULL)) {
    377370      ret = saymsg(MB_YESNO,
    378371                   HWND_DESKTOP,
Note: See TracChangeset for help on using the changeset viewer.