INCLUDE File Search Path
ID Number:  Q11342

4.00
MS-DOS
enduser | 

Question:
   MASM is using the wrong search path for INCLUDE files when the file
name begins with "/", "\", ".", or a drive letter followed by a colon. 

Response:
   Microsoft has confirmed this to be a problem in Version 4.00 of
Macro Assembler. The problem is corrected in Version 5.00. 
   The correct search path for INCLUDE files in MASM is the following: 

   1. If the file name begins with "/", "\", ".", or a drive letter
followed by a colon, search using only the path as specified. 
   2. Otherwise use all the /I paths in order, then use the current
directory. 

   MASM Version 4.00 does not work correctly. The path it uses is the
following: 

   1. Any INCLUDE file specified with a drive specifier is searched
for on the named drive in the named directory. 
   2. All other INCLUDE files are searched for in the directories
specified on the command line, from left to right. If a full path name
is specified, the leading "\" is stripped and the remainder is treated
as a partial path name. 
   3. Any files specified with a full path name are searched for in
the given directory. 
   4. Otherwise, the current directory is searched.

   The problem is that a leading "/", "\", or "." is not respected. 
   The workaround for INCLUDE file names with a leading "/" or "\" is
to include a drive-specifier as well. 
   The workaround for INCLUDE file names with a leading "." is to
specify "/I." on the command line before any other "/I" arguments. 
   Note that if you want to specify the root directory of another
drive, use "/IC:" instead of "/IC:\". The latter is not recognized. 
   Using a directory to find a file means appending the file name as
written to the directory name (including a terminating slash in the
directory name). 
