summaryrefslogtreecommitdiff
path: root/core/src/xmake/os/tmpdir.c
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/xmake/os/tmpdir.c')
-rw-r--r--core/src/xmake/os/tmpdir.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/core/src/xmake/os/tmpdir.c b/core/src/xmake/os/tmpdir.c
index b2c3a0c43..6d20fc546 100644
--- a/core/src/xmake/os/tmpdir.c
+++ b/core/src/xmake/os/tmpdir.c
@@ -22,8 +22,8 @@
/* //////////////////////////////////////////////////////////////////////////////////////
* trace
*/
-#define TB_TRACE_MODULE_NAME "tmpdir"
-#define TB_TRACE_MODULE_DEBUG (0)
+#define TB_TRACE_MODULE_NAME "tmpdir"
+#define TB_TRACE_MODULE_DEBUG (0)
/* //////////////////////////////////////////////////////////////////////////////////////
* includes
@@ -33,14 +33,15 @@
/* //////////////////////////////////////////////////////////////////////////////////////
* implementation
*/
-tb_int_t xm_os_tmpdir(lua_State* lua)
-{
- // check
+tb_int_t xm_os_tmpdir(lua_State *lua) {
tb_assert_and_check_return_val(lua, 0);
// os.tmpdir()
tb_char_t path[TB_PATH_MAXN];
- if (tb_directory_temporary(path, sizeof(path))) lua_pushstring(lua, path);
- else lua_pushnil(lua);
+ if (tb_directory_temporary(path, sizeof(path))) {
+ lua_pushstring(lua, path);
+ } else {
+ lua_pushnil(lua);
+ }
return 1;
}