Skip to content

Commit 7aaec18

Browse files
Create unique executable file
1 parent d5792fe commit 7aaec18

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/bin/lpython.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -927,8 +927,8 @@ int link_executable(const std::vector<std::string> &infiles,
927927
std::cout << "The command '" + cmd + "' failed." << std::endl;
928928
return 10;
929929
}
930-
if (outfile == "a.out" && compiler_options.arg_o == "") {
931-
err = system("a.out");
930+
if (compiler_options.arg_o == "") {
931+
err = system(outfile.c_str());
932932
if (err != 0) {
933933
if (0 < err && err < 256) {
934934
return err;
@@ -962,8 +962,8 @@ int link_executable(const std::vector<std::string> &infiles,
962962
std::cout << "The command '" + cmd + "' failed." << std::endl;
963963
return 10;
964964
}
965-
if (outfile == "a.out" && compiler_options.arg_o == "") {
966-
err = system("./a.out");
965+
if (compiler_options.arg_o == "") {
966+
err = system(("./" + outfile).c_str());
967967
if (err != 0) {
968968
if (0 < err && err < 256) {
969969
return err;
@@ -1441,7 +1441,7 @@ int main(int argc, char *argv[])
14411441
} else if (show_wat) {
14421442
outfile = basename + ".wat";
14431443
} else {
1444-
outfile = "a.out";
1444+
outfile = basename + ".out";
14451445
}
14461446

14471447
// if (arg_E) {

0 commit comments

Comments
 (0)