Loading src/slideshow.c +0 −23 Original line number Diff line number Diff line Loading @@ -464,29 +464,6 @@ void feh_action_run(feh_file * file, char *action, winwidget winwid) return; } char *shell_escape(char *input) { static char ret[1024]; unsigned int out = 0, in = 0; ret[out++] = '\''; for (in = 0; input[in] && (out < (sizeof(ret) - 7)); in++) { if (input[in] == '\'') { ret[out++] = '\''; ret[out++] = '"'; ret[out++] = '\''; ret[out++] = '"'; ret[out++] = '\''; } else ret[out++] = input[in]; } ret[out++] = '\''; ret[out++] = '\0'; return ret; } char *format_size(int size) { static char ret[5]; Loading src/utils.c +23 −0 Original line number Diff line number Diff line Loading @@ -201,3 +201,26 @@ char *ereadfile(char *path) return estrdup(buffer); } char *shell_escape(char *input) { static char ret[1024]; unsigned int out = 0, in = 0; ret[out++] = '\''; for (in = 0; input[in] && (out < (sizeof(ret) - 7)); in++) { if (input[in] == '\'') { ret[out++] = '\''; ret[out++] = '"'; ret[out++] = '\''; ret[out++] = '"'; ret[out++] = '\''; } else ret[out++] = input[in]; } ret[out++] = '\''; ret[out++] = '\0'; return ret; } src/utils.h +1 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,7 @@ char *estrjoin(const char *separator, ...); char path_is_url(char *path); char *feh_unique_filename(char *path, char *basename); char *ereadfile(char *path); char *shell_escape(char *input); #define ESTRAPPEND(a,b) \ {\ Loading Loading
src/slideshow.c +0 −23 Original line number Diff line number Diff line Loading @@ -464,29 +464,6 @@ void feh_action_run(feh_file * file, char *action, winwidget winwid) return; } char *shell_escape(char *input) { static char ret[1024]; unsigned int out = 0, in = 0; ret[out++] = '\''; for (in = 0; input[in] && (out < (sizeof(ret) - 7)); in++) { if (input[in] == '\'') { ret[out++] = '\''; ret[out++] = '"'; ret[out++] = '\''; ret[out++] = '"'; ret[out++] = '\''; } else ret[out++] = input[in]; } ret[out++] = '\''; ret[out++] = '\0'; return ret; } char *format_size(int size) { static char ret[5]; Loading
src/utils.c +23 −0 Original line number Diff line number Diff line Loading @@ -201,3 +201,26 @@ char *ereadfile(char *path) return estrdup(buffer); } char *shell_escape(char *input) { static char ret[1024]; unsigned int out = 0, in = 0; ret[out++] = '\''; for (in = 0; input[in] && (out < (sizeof(ret) - 7)); in++) { if (input[in] == '\'') { ret[out++] = '\''; ret[out++] = '"'; ret[out++] = '\''; ret[out++] = '"'; ret[out++] = '\''; } else ret[out++] = input[in]; } ret[out++] = '\''; ret[out++] = '\0'; return ret; }
src/utils.h +1 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,7 @@ char *estrjoin(const char *separator, ...); char path_is_url(char *path); char *feh_unique_filename(char *path, char *basename); char *ereadfile(char *path); char *shell_escape(char *input); #define ESTRAPPEND(a,b) \ {\ Loading