diff --git a/source/qb64pe.bas b/source/qb64pe.bas index 8847727e9..544b346a6 100644 --- a/source/qb64pe.bas +++ b/source/qb64pe.bas @@ -4472,7 +4472,11 @@ DO GOTO GotHeader END IF ' a740g: Fallback to source path - libpath$ = FixDirectoryName(idepath$) + og_libpath$ + IF inclevel > 0 THEN + libpath$ = getfilepath(incname(inclevel)) + og_libpath$ + ELSE + libpath$ = FixDirectoryName(idepath$) + og_libpath$ + END IF libpath_inline$ = GetEscapedPath(libpath$) IF _FILEEXISTS(libpath$ + x$ + ".h") THEN headername$ = libpath_inline$ + x$ + ".h" @@ -4539,7 +4543,11 @@ DO GOTO GotHeader END IF ' a740g: Fallback to source path - libpath$ = FixDirectoryName(idepath$) + og_libpath$ + IF inclevel > 0 THEN + libpath$ = getfilepath(incname(inclevel)) + og_libpath$ + ELSE + libpath$ = FixDirectoryName(idepath$) + og_libpath$ + END IF libpath_inline$ = GetEscapedPath(libpath$) IF _FILEEXISTS(libpath$ + x$ + ".h") THEN headername$ = libpath_inline$ + x$ + ".h" diff --git a/source/utilities/file.bas b/source/utilities/file.bas index 9f7ce5e8a..cb5df849a 100644 --- a/source/utilities/file.bas +++ b/source/utilities/file.bas @@ -113,7 +113,7 @@ FUNCTION GetEscapedPath$ (path_name AS STRING) GetEscapedPath = buf END FUNCTION -' Adds a trailing \ or / if to the name if needed +' Adds a trailing \ or / to a directory name if needed FUNCTION FixDirectoryName$ (dir_name AS STRING) IF LEN(dir_name) > 0 AND RIGHT$(dir_name, 1) <> pathsep$ THEN FixDirectoryName = dir_name + pathsep$