summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-08-22 22:52:19 +0800
committerruki <[email protected]>2024-08-22 22:52:19 +0800
commit6e8697ed326e5dc8424812681754e341152cf635 (patch)
tree7781f584dde504feaf7c494cccc1a9ac950d36ad
parentb657911e2b0c34674570368c73c5025eff9d7649 (diff)
fix engine
-rw-r--r--core/src/xmake/engine.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/core/src/xmake/engine.c b/core/src/xmake/engine.c
index 8aa010914..69307a46f 100644
--- a/core/src/xmake/engine.c
+++ b/core/src/xmake/engine.c
@@ -745,12 +745,14 @@ static tb_size_t xm_engine_get_program_file(xm_engine_t* engine, tb_char_t** arg
}
#endif
- tb_char_t const* p = argv? argv[0] : tb_null;
- if (p && tb_file_info(p, tb_null))
+ if (!ok && argv)
{
- tb_strlcpy(path, p, maxn);
- ok = tb_true;
- break;
+ tb_char_t const* p = argv[0];
+ if (p && tb_file_info(p, tb_null))
+ {
+ tb_strlcpy(path, p, maxn);
+ ok = tb_true;
+ }
}
} while (0);