static Eina_Bool
_screen_recorder_fullpath_make_with_ext(char out[PATH_MAX], const char *filename)
{
- char cwd[PATH_MAX], fullname[PATH_MAX] = {0,};
+ char fullname[PATH_MAX] = {0,};
char *dot;
const char *ext = ".mp4";
const char *prefix = "e-screen-record";
+ const char *default_path = "/tmp";
int len_l, len;
len_l = PATH_MAX;
if (filename)
{
if (filename[0] != '/')
- {
- if (!getcwd(cwd, sizeof(cwd)))
- snprintf(cwd, sizeof(cwd), "/tmp");
-
- len = snprintf(fullname, len_l, "%s/%s", cwd, filename);
- }
+ len = snprintf(fullname, len_l, "%s/%s", default_path, filename);
else
len = snprintf(fullname, len_l, "%s", filename);
if (!t)
return EINA_FALSE;
- if (!getcwd(cwd, sizeof(cwd)))
- snprintf(cwd, sizeof(cwd), "/tmp");
-
len = snprintf(fullname, len_l, "%s/%s-%04d%02d%02d.%02d%02d%02d",
- cwd, prefix,
+ default_path, prefix,
t->tm_year+1900, t->tm_mon+1, t->tm_mday, t->tm_hour,
t->tm_min, t->tm_sec);
len_l -= len;