From b8b4b13302a27fb731ad21567cd4bdd5a47a616b Mon Sep 17 00:00:00 2001 From: Fellippe Heitor Date: Tue, 21 Jun 2016 23:53:43 -0300 Subject: [PATCH] Relative paths for external libraries External libraries can now sit in the same folder as your source file without the need to specify a full path. You can use .libraryname or ./libraryname with DECLARE LIBRARY statement blocks. --- source/qb64.bas | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/source/qb64.bas b/source/qb64.bas index 7f6b9adb4..4bc1812e5 100644 --- a/source/qb64.bas +++ b/source/qb64.bas @@ -3686,7 +3686,7 @@ DO LOOP END IF - 'Seperate path from name + 'Separate path from name libpath$ = "" FOR z = LEN(x$) TO 1 STEP -1 a = ASC(x$, z) @@ -3697,6 +3697,17 @@ DO END IF NEXT + 'Accept ./ and .\ as a reference to the source file + 'folder, replacing it with the actual full path, if available + IF libpath$ = "./" OR libpath$ = ".\" THEN + libpath$ = "" + IF NoIDEMode THEN + IF LEFT$(path.exe$, 2) <> ".." THEN libpath$ = path.exe$ + ELSE + IF LEN(ideprogname) THEN libpath$ = idepath$ + pathsep$ + END IF + END IF + 'Create a path which can be used for inline code (uses \\ instead of \) libpath_inline$ = "" FOR z = 1 TO LEN(libpath$)