Exploit the value of the flag for -n to reduce the compiled size of readlink_main() from 79 to 76 bytes on x86_64.
Signed-off-by: Eric Blake <[email protected]> --- coreutils/readlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreutils/readlink.c b/coreutils/readlink.c index 0a9aa957e..83c417e66 100644 --- a/coreutils/readlink.c +++ b/coreutils/readlink.c @@ -88,8 +88,8 @@ int readlink_main(int argc UNUSED_PARAM, char **argv) if (!buf) return EXIT_FAILURE; - printf((opt & 1) ? "%s" : "%s\n", buf); + printf("%s%s", buf, "\n"[opt & 1]); free(buf); fflush_stdout_and_exit_SUCCESS(); -- 2.39.2 _______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
