diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/menu.c | 12 | ||||
-rw-r--r-- | src/wallpaper.c | 6 |
2 files changed, 9 insertions, 9 deletions
@@ -1183,24 +1183,20 @@ void feh_menu_cb(feh_menu * m, feh_menu_item * i, int action, unsigned short dat switch (action) { case CB_BG_TILED: - path = feh_absolute_path(FEH_FILE(m->fehwin->file->data)->filename); + path = FEH_FILE(m->fehwin->file->data)->filename; feh_wm_set_bg(path, m->fehwin->im, 0, 0, 0, data, 0); - free(path); break; case CB_BG_SCALED: - path = feh_absolute_path(FEH_FILE(m->fehwin->file->data)->filename); + path = FEH_FILE(m->fehwin->file->data)->filename; feh_wm_set_bg(path, m->fehwin->im, 0, 1, 0, data, 0); - free(path); break; case CB_BG_CENTERED: - path = feh_absolute_path(FEH_FILE(m->fehwin->file->data)->filename); + path = FEH_FILE(m->fehwin->file->data)->filename; feh_wm_set_bg(path, m->fehwin->im, 1, 0, 0, data, 0); - free(path); break; case CB_BG_FILLED: - path = feh_absolute_path(FEH_FILE(m->fehwin->file->data)->filename); + path = FEH_FILE(m->fehwin->file->data)->filename; feh_wm_set_bg(path, m->fehwin->im, 0, 0, 1, data, 0); - free(path); break; case CB_BG_TILED_NOFILE: feh_wm_set_bg(NULL, m->fehwin->im, 0, 0, 0, data, 0); diff --git a/src/wallpaper.c b/src/wallpaper.c index 886beb6..b5945f0 100644 --- a/src/wallpaper.c +++ b/src/wallpaper.c @@ -310,6 +310,8 @@ void feh_wm_set_bg(char *fil, Imlib_Image im, int centered, int scaled, if (fil && !use_filelist) { filbuf[out++] = '\''; + fil = feh_absolute_path(fil); + for (in = 0; fil[in] && out < 4092; in++) { if (fil[in] == '\'') @@ -317,12 +319,13 @@ void feh_wm_set_bg(char *fil, Imlib_Image im, int centered, int scaled, filbuf[out++] = fil[in]; } filbuf[out++] = '\''; + free(fil); } else { for (l = filelist; l && out < 4092; l = l->next) { filbuf[out++] = '\''; - fil = FEH_FILE(l->data)->filename; + fil = feh_absolute_path(FEH_FILE(l->data)->filename); for (in = 0; fil[in] && out < 4092; in++) { @@ -332,6 +335,7 @@ void feh_wm_set_bg(char *fil, Imlib_Image im, int centered, int scaled, } filbuf[out++] = '\''; filbuf[out++] = ' '; + free(fil); } } |