kwo pushed a commit to branch master. http://git.enlightenment.org/legacy/imlib2.git/commit/?id=f9c10c19e3239df482505770463c801ab8def89f
commit f9c10c19e3239df482505770463c801ab8def89f Author: Kim Woelders <[email protected]> Date: Fri Nov 22 20:31:51 2019 +0100 imlib2_load: Optionally write to stderr instead of stdout Sometimes useful when testing with valgrind. --- src/bin/imlib2_load.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/bin/imlib2_load.c b/src/bin/imlib2_load.c index 60c2869..4c6817f 100644 --- a/src/bin/imlib2_load.c +++ b/src/bin/imlib2_load.c @@ -10,6 +10,7 @@ #define PROG_NAME "imlib2_load" static char progress_called; +static FILE *fout; static void usage(int exit_status) @@ -38,6 +39,7 @@ main(int argc, char **argv) int check_progress; int break_on_error; + fout = stdout; check_progress = 0; break_on_error = 0; @@ -58,6 +60,9 @@ main(int argc, char **argv) case 'p': check_progress = 1; break; + case 'x': + fout = stderr; + break; } } @@ -74,7 +79,7 @@ main(int argc, char **argv) { progress_called = 0; - printf("Loading image: '%s'\n", argv[0]); + fprintf(fout, "Loading image: '%s'\n", argv[0]); lerr = 0; if (check_progress) @@ -83,7 +88,7 @@ main(int argc, char **argv) im = imlib_load_image(argv[0]); if (!im) { - printf("*** Error %d loading image: %s\n", lerr, argv[0]); + fprintf(fout, "*** Error %d loading image: %s\n", lerr, argv[0]); if (break_on_error & 2) break; continue; @@ -94,7 +99,7 @@ main(int argc, char **argv) if (check_progress && !progress_called) { - printf("*** No progress during image load\n"); + fprintf(fout, "*** No progress during image load\n"); if (break_on_error & 1) break; } --
