summaryrefslogtreecommitdiff
path: root/core/src/xmake/binutils/readsyms.c
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/xmake/binutils/readsyms.c')
-rw-r--r--core/src/xmake/binutils/readsyms.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/core/src/xmake/binutils/readsyms.c b/core/src/xmake/binutils/readsyms.c
index 145488c93..407ba7399 100644
--- a/core/src/xmake/binutils/readsyms.c
+++ b/core/src/xmake/binutils/readsyms.c
@@ -120,9 +120,14 @@ tb_int_t xm_binutils_readsyms(lua_State *lua) {
// object name
lua_pushstring(lua, "objectfile");
tb_char_t const* name = tb_strrchr(objectfile, '/');
- if (!name) name = tb_strrchr(objectfile, '\\');
- if (!name) name = objectfile;
- else name++;
+ if (!name) {
+ name = tb_strrchr(objectfile, '\\');
+ }
+ if (!name) {
+ name = objectfile;
+ } else {
+ name++;
+ }
lua_pushstring(lua, name);
lua_settable(lua, -3);