From f223cfe0287e828112e382120a9d9d0a93cdf5f1 Mon Sep 17 00:00:00 2001 From: FellippeHeitor Date: Sun, 22 Oct 2017 17:16:54 -0200 Subject: [PATCH] Restore SUB Build's "count separators" method to please Windows XP. --- source/qb64.bas | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/source/qb64.bas b/source/qb64.bas index cd56a6dce..4cafe68d2 100644 --- a/source/qb64.bas +++ b/source/qb64.bas @@ -23224,9 +23224,18 @@ END IF END SUB SUB Build (path$) -previous_dir$ = _CWD$ +'Count the separators in the path +depth = 1 +FOR x = 1 TO LEN(path$) + IF ASC(path$, x) = 92 OR ASC(path$, x) = 47 THEN depth = depth + 1 +NEXT CHDIR path$ +return_path$ = ".." +FOR x = 2 TO depth + return_path$ = return_path$ + "\.." +NEXT + bfh = FREEFILE OPEN "build" + BATCHFILE_EXTENSION FOR BINARY AS #bfh DO UNTIL EOF(bfh) @@ -23240,15 +23249,15 @@ DO UNTIL EOF(bfh) c$ = GDB_Fix$(c$) IF use THEN IF os$ = "WIN" THEN - SHELL _HIDE "cmd /C " + c$ + " 2>> " + previous_dir$ + "\" + compilelog$ + SHELL _HIDE "cmd /C " + c$ + " 2>> " + return_path$ + "\" + compilelog$ ELSE - SHELL _HIDE c$ + " 2>> " + previous_dir$ + "/" + compilelog$ + SHELL _HIDE c$ + " 2>> " + return_path$ + "/" + compilelog$ END IF END IF LOOP CLOSE #bfh -CHDIR previous_dir$ +CHDIR return_path$ END SUB