tmp2 = g_strdup (lua_src);
lua_dir = dirname (tmp1);
lua_file = basename (tmp2);
+
if (lua_dir && lua_file) {
cur_dir = g_malloc (PATH_MAX);
if (getcwd (cur_dir, PATH_MAX) != NULL && chdir (lua_dir) != -1) {
lua_tostring (L, -1));
if (chdir (cur_dir) == -1) {
msg_err ("cannot chdir to %s: %s", cur_dir,
- strerror (errno));;
+ strerror (errno));
}
g_free (cur_dir);
g_free (tmp1);
lua_tostring (L, -1));
if (chdir (cur_dir) == -1) {
msg_err ("cannot chdir to %s: %s", cur_dir,
- strerror (errno));;
+ strerror (errno));
}
g_free (cur_dir);
g_free (tmp1);
g_set_error (err, CFG_RCL_ERROR, ENOENT, "cannot chdir to %s: %s",
lua_src, strerror (errno));
if (chdir (cur_dir) == -1) {
- msg_err ("cannot chdir to %s: %s", cur_dir, strerror (errno));;
+ msg_err ("cannot chdir to %s: %s", cur_dir, strerror (errno));
}
g_free (cur_dir);
g_free (tmp1);
}
if (chdir (cur_dir) == -1) {
- msg_err ("cannot chdir to %s: %s", cur_dir, strerror (errno));;
+ msg_err ("cannot chdir to %s: %s", cur_dir, strerror (errno));
}
g_free (cur_dir);
g_free (tmp1);
g_free (tmp2);
}
else {
+ g_free (tmp1);
+ g_free (tmp2);
g_set_error (err, CFG_RCL_ERROR, ENOENT, "cannot find to %s: %s",
lua_src, strerror (errno));
return FALSE;