Unverified Commit 6286313e authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

Disallow %f/%n format specifiers for --action and --info

parent 8a4ca454
Loading
Loading
Loading
Loading
+22 −5
Original line number Diff line number Diff line
@@ -1294,12 +1294,20 @@ Information about slideshow state (playing/paused)
.
.It %f
.
Image path/filename
Image path/filename.
Not supported in
.Cm \-\-action
and
.Cm \-\-info
due to lack of shell escapes
.Pq use %F instead .
.
.It %F
.
Escaped image path/filename
.Pq for use in shell commands
Escaped image path/filename for use in
.Cm \-\-action ,
.Cm \-\-info ,
and other shell commands.
.
.It %g
.
@@ -1324,11 +1332,20 @@ Current mode
.
.It %n
.
Image name
Image name.
Not supported in
.Cm \-\-action
and
.Cm \-\-info
due to lack of shell escapes
.Pq use \&%N instead .
.
.It \&%N
.
Escaped image name
Escaped image name for use in
.Cm \-\-action ,
.Cm \-\-info ,
and other shell commands.
.
.It %o
.
+1 −1
Original line number Diff line number Diff line
@@ -165,7 +165,7 @@ void feh_event_handle_generic(winwidget winwid, unsigned int state, KeySym keysy
fehkey *feh_str_to_kb(char * action);
void feh_action_run(feh_file * file, char *action, winwidget winwid);
char *format_size(double size);
char *feh_printf(char *str, feh_file * file, winwidget winwid);
char *feh_printf(char *str, feh_file * file, winwidget winwid, int shell);
void im_weprintf(winwidget w, char *fmt, ...);
void feh_draw_zoom(winwidget w);
void feh_draw_checks(winwidget win);
+1 −1
Original line number Diff line number Diff line
@@ -1284,7 +1284,7 @@ void feh_draw_info(winwidget w)

	fn = feh_load_font(w);

	info_cmd = feh_printf(opt.info_cmd, FEH_FILE(w->file->data), w);
	info_cmd = feh_printf(opt.info_cmd, FEH_FILE(w->file->data), w, 1);

	info_pipe = popen(info_cmd, "r");
	free(info_cmd);
+1 −1
Original line number Diff line number Diff line
@@ -475,7 +475,7 @@ void get_index_string_dim(feh_file *file, Imlib_Font fn, int *fw, int *fh)

char *create_index_string(feh_file * file)
{
	return feh_printf(opt.index_info, file, NULL);
	return feh_printf(opt.index_info, file, NULL, 0);
}

char *create_index_title_string(int num, int w, int h)
+1 −1
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ void init_list_mode(void)
	for (l = filelist; l; l = l->next) {
		file = FEH_FILE(l->data);
		if (opt.customlist) {
			char *tmp = feh_printf(opt.customlist, file, NULL);
			char *tmp = feh_printf(opt.customlist, file, NULL, 0);
			puts(tmp);
			free(tmp);
		} else {
Loading