Changeset 1398 for trunk/dll/srchpath.c


Ignore:
Timestamp:
Feb 21, 2009, 6:43:00 PM (16 years ago)
Author:
Gregg Young
Message:

Move embeded strings to PCSZ variables or string table; Eliminate Error2 functions Runtime_Error with NULL format string returns "No data" error. Change declares from PSZ to PCSZ in functions where the variable isn't changed. Added btm as an executable file type in several additional places. Use fProtectOnly to prevent attempt to execute Dos and Win programs on "Protect only" installs in several additional places.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/srchpath.c

    r1321 r1398  
    3030#include "systemf.h"                    // runemf2
    3131#include "notebook.h"                   // Data declaration(s)
     32#include "init.h"                       // Data declaration(s)
    3233
    3334static PSZ pszSrcFile = __FILE__;
     
    4041//== Search PATH plus 2 default install dirs ==
    4142
    42 INT RunFM2Util(CHAR *appname, CHAR *filename)
     43INT RunFM2Util(PCSZ appname, CHAR *filename)
    4344{
    4445    CHAR fbuf[CCHMAXPATH];
     
    4748
    4849    rc = DosSearchPath(SEARCH_IGNORENETERRS |SEARCH_ENVIRONMENT |
    49                        SEARCH_CUR_DIRECTORY,"PATH",
     50                       SEARCH_CUR_DIRECTORY, PCSZ_PATH,
    5051                       appname, (PBYTE)fbuf, CCHMAXPATH - 1);
    5152      if (rc != 0) {
    5253        if (rc != 2){
    5354        Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__,
    54                   "DosSearchPath", appname);
     55                  PCSZ_DOSSEARCHPATH, appname);
    5556        return ret;
    5657        }
     
    6061            if (rc != 0 && rc != 2){
    6162              Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__,
    62                         "DosSearchPath", appname);
     63                        PCSZ_DOSSEARCHPATH, appname);
    6364              return ret;
    6465            }
     
    104105 */
    105106
    106 CHAR *searchapath(CHAR *pathvar, CHAR *filename)
     107CHAR *searchapath(PCSZ pathvar, PCSZ filename)
    107108{
    108109  static CHAR fbuf[CCHMAXPATH];
     
    113114    FILESTATUS3 fsa;
    114115
    115     if (!DosQueryPathInfo(filename, FIL_STANDARD, &fsa, (ULONG) sizeof(fsa)))
    116       return filename;
     116    strcpy(fbuf, filename);
     117    if (!DosQueryPathInfo(fbuf, FIL_STANDARD, &fsa, (ULONG) sizeof(fsa)))
     118      return fbuf;
    117119    *fbuf = 0;
    118120    return fbuf;
     
    126128}
    127129
    128 CHAR *searchpath(CHAR * filename)
     130CHAR *searchpath(PCSZ filename)
    129131{
    130132  CHAR *found;
     
    132134  if (!filename)
    133135    return "";
    134   found = searchapath("PATH", filename);
     136  found = searchapath(PCSZ_PATH, filename);
    135137  if (!*found) {
    136138    found = searchapath("DPATH", filename);
Note: See TracChangeset for help on using the changeset viewer.