commit e4e657f976e8812a389b6f46d4778dba133b84b1
parent 1e6f62aa19a0eca3dd6ec9556a029f3a76b6cec4
Author: Remy Noulin <loader2x@gmail.com>
Date: Fri, 5 Jun 2020 21:00:29 +0200
fix bug preventing running program linking packages from any directory
src/sheepy.c | 6 ++++++
1 file changed, 6 insertions(+)
Diffstat:
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/src/sheepy.c b/src/sheepy.c
@@ -1588,6 +1588,9 @@ int MAIN(int ARGC, char** ARGV) {
// modify dir when main is cp
// TODO remove -I dir not needed
if (isCP(mainSrc)) {
+ // TODO use another variable, keep dir as the path to the original main src from the command line argument
+ // because dir is used to find the packages
+ // the new variable should be used in the compile commands below
iPrependS(&dir, "/");
iPrependS(&dir, buildPath);
}
@@ -1875,6 +1878,9 @@ int MAIN(int ARGC, char** ARGV) {
//logVarG(arr);
free(s);
+ // add path to main file to be able to run program from any
+ // directory
+ prependG(arr, dir);
s = joinSG(arr, "/");
terminateG(arr);
if (!fileExists(s)) {