Changeset 4793 for trunk/src


Ignore:
Timestamp:
Dec 12, 2000, 8:09:48 PM (25 years ago)
Author:
bird
Message:

Corrected a race due to bad end-of-loop detechtion in SearchPaths.
Changed the file clipping SearchPaths so it will work for BOOKSHELF search
for the DDK base directory.
Corrected search for the DDK base directory.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/win32k/configure.cmd

    r4776 r4793  
    1 /* $Id: configure.cmd,v 1.13 2000-12-11 06:27:57 bird Exp $
     1/* $Id: configure.cmd,v 1.14 2000-12-12 19:09:48 bird Exp $
    22 *
    33 * Configuration script.
     
    2727
    2828    /* create empty .depend file */
    29     'echo #run nmake dep > .depend'
     29    call lineout '.depend', '# Run nmake dep'
     30    call lineout '.depend'
    3031
    3132    /* open target file */
     
    6667        call lineout sIncFile, '# DDKPATH: base directory of ddk base. (ie. \DDK\BASE not \DDK for DDK v4.0+)'
    6768        call lineout sIncFile, '################################################################################'
    68         sDDK = SearchPaths('INCLUDE', '..\h\dhcalls.h', 'PATH', '..\h\dhcalls.h', 'BOOKSHELF', '..\h\dhcalls.h', 'Path to DDK "\BASE" directory (ie. F:\DDK\BASE):');
     69        sDDK = SearchPaths('INCLUDE', '..\h\dhcalls.h', 'PATH', '..\h\dhcalls.h', 'BOOKSHELF', '..\base\.\h\dhcalls.h', 'Path to DDK "\BASE" directory (ie. F:\DDK\BASE):');
    6970        call lineout sIncFile, 'DDKPATH          =' sDDK
    7071        call lineout sIncFile, ''
     
    155156SearchPaths: procedure expose fInteractive;
    156157    i = 1;
    157     sEnv  = arg(i);
    158     sFile = arg(i+1);
    159158    sPath = '';
    160     do while (sPath == '' & sEnv <> '' & sFile <> '')
     159
     160    /*
     161     * Search for the given environments/files combinations.
     162     */
     163    do i = 2 to arg() by 2
     164        sEnv  = arg(i-1);
     165        sFile = arg(i);
     166        say i':' sEnv '-' sFile;
    161167        sPath = SysSearchPath(sEnv, sFile);
    162         /* debug: say 'sEnv:'sEnv 'sFile:'sFile 'sPath:'sPath 'i:'i */
    163         i = i + 2;
    164         if (arg() > i + 1) then
    165         do
    166             sEnv  = arg(i);
    167             sFile = arg(i+1);
    168         end
    169     end
    170 
    171     if (sPath == '' & sEnv <> '' & sFile == '') then
    172     do
    173         say sEnv;
     168        say 'SysSearchPath('sEnv',' sFile') ->' sPath;
     169        if (sPath <> '') then
     170           leave;
     171    end
     172
     173    /* did we find it? */
     174    if (sPath = '') then
     175    do  /*
     176         * If interactive mode, we'll ask for the the path, else skip it.
     177         */
     178        say arg(arg());
    174179        if (fInteractive = 1) then
    175180            sPath = linein();
     
    178183    end
    179184    else
    180     do
    181         if (sPath <> '') then
    182         do
    183             /* look for ..\. */
    184             i = lastpos('..\', sFile);
    185             if (i <> 0) then
    186                 sFile = substr(sFile, i + 2);
    187 
    188             /* cut equally */
    189             i = lastpos(sFile, sPath);
    190             if i == 0 then
    191                 say '!error! sFile:'sFile  'sPath:'sPath;
    192             /* debug: say 'sPath:'sPath  'sFile:'sFile */
    193             sPath = substr(sPath, 1, i-1);
    194         end
     185    do  /*
     186         * Trim the result for the file part.
     187         */
     188        /* look for .\ or ..\ */
     189        i = lastpos('.\', sFile);
     190        if (i <> 0) then
     191            sFile = substr(sFile, i + 1);
     192
     193        /* cut equally */
     194        i = lastpos(sFile, sPath);
     195        if (i = 0) then
     196            say '!error! sFile:'sFile  'sPath:'sPath;
     197        /* debug: say 'sPath:'sPath  'sFile:'sFile */
     198        sPath = substr(sPath, 1, i-1);
    195199    end
    196200
Note: See TracChangeset for help on using the changeset viewer.