]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
build: fix SINGLE_BINARY build when printf is a macro
authorYunlian Jiang <yunlian@chromium.org>
Tue, 28 Apr 2015 22:47:20 +0000 (23:47 +0100)
committerPádraig Brady <P@draigBrady.com>
Tue, 28 Apr 2015 22:48:30 +0000 (23:48 +0100)
* src/coreutils.c (usage): include coreutils.h outside
the printf call, because if it's a macro you will get the error:
embedding a #include directive within macro arguments is not supported

src/coreutils.c

index 9f798b808167c3de52543a3427022b6bd4ad9fee..7f868347dac7741e61b5522833f5f52083056a5f 100644 (file)
@@ -70,15 +70,17 @@ Execute the PROGRAM_NAME built-in program with the given PARAMETERS.\n\
       fputs (HELP_OPTION_DESCRIPTION, stdout);
       fputs (VERSION_OPTION_DESCRIPTION, stdout);
 
-      printf ("\n\
-Built-in programs:\n"
 #ifdef SINGLE_BINARY
-/* XXX: Ideally we#d like to present "install" here, not "ginstall".  */
+/* XXX: Ideally we'd like to present "install" here, not "ginstall".  */
+      char const *prog_name_list =
 # define SINGLE_BINARY_PROGRAM(prog_name_str, main_name) " " prog_name_str
 # include "coreutils.h"
 # undef SINGLE_BINARY_PROGRAM
+      ;
+      printf ("\n\
+Built-in programs:\n\
+%s\n", prog_name_list);
 #endif
-  "\n");
 
       printf (_("\
 \n\