diff --git a/repl/main.c b/repl/main.c index 0ef84ed..91d4587 100644 --- a/repl/main.c +++ b/repl/main.c @@ -239,8 +239,8 @@ CmdLine parseCmdLine(int argc, const char* argv[]) { i++; - //total space to reserve - it's actually longer than needed, due to the exe name being removed - cmd.infileLength = strlen(argv[0]) + strlen(argv[i]) + 1; + //total space to reserve + cmd.infileLength = strlen(argv[i]) + 1; cmd.infileLength = (cmd.infileLength + 3) & ~3; //BUGFIX: align to word size for malloc() cmd.infile = malloc(cmd.infileLength); @@ -249,9 +249,7 @@ CmdLine parseCmdLine(int argc, const char* argv[]) { exit(-1); } - getFilePath(cmd.infile, argv[0]); - APPEND(cmd.infile, argv[i]); - FLIPSLASH(cmd.infile); + strncpy(cmd.infile, argv[i], strlen(argv[i])); } } diff --git a/tests/scripts/makefile b/tests/scripts/makefile index f344aa8..dca4d25 100644 --- a/tests/scripts/makefile +++ b/tests/scripts/makefile @@ -41,7 +41,7 @@ copy: run: $(TEST_SCRIPTFILES:.toy=.toy-run) %.toy-run: %.toy - find -name repl* -type f -exec {} -f ../$< --verbose \; + find -name repl* -type f -exec {} -f $< --verbose \; #using gdb gdb: source repl copy run-gdb @@ -49,4 +49,4 @@ gdb: source repl copy run-gdb run-gdb: $(TEST_SCRIPTFILES:.toy=.toy-run-gdb) %.toy-run-gdb: %.toy - gdb $(TEST_OUTDIR)/$(TEST_REPLNAME) -ix gdb_init -ex=run --batch --return-child-result --args "out/repl.out" "-f" "../$<" "--verbose" \ No newline at end of file + gdb $(TEST_OUTDIR)/$(TEST_REPLNAME) -ix gdb_init -ex=run --batch --return-child-result --args "out/repl.out" "-f" "$<" "--verbose" \ No newline at end of file