architecture: bfin version: 1.15 (can not reproduce on pc even with BUILD_AS_NOMMU set to 1) The following command: printf line > testfile.txt In hush prints "line" to the console and leaves testfile.txt void In bash testfile.txt contains "line" The command: printf "line1\nline2" > testfile.txt In hush prints "line2" to the console and testfile.txt contains "line1" In bash "line1\n"line2" is written to testfile.txt thanks in advance, Mikel Garai
I forgot to say that the command: printf line | cat > file.txt does the right thing writting "line" to file.txt
Does it help if you add a fflush(NULL) in hush.c like this: static int run_applet_main(char **argv, int (*applet_main_func)(int argc, char **argv)) { int argc = 0; while (*argv) { argc++; argv++; } - return applet_main_func(argc, argv - argc); + argc = applet_main_func(argc, argv - argc); + fflush(NULL); + return argc; }
Any news?
I did not have any time to test it jet, because the patch is not applicable to the version of busybox that I am using (1.15.3, that has no function called run_applet_main in hush.c), and it takes some time to set up everything to test other version. Anyway I will try it ASAP, that could be more time than I would like to be. Thanks, Mikel
I just tested the unstable busybox's hush (1.16.0) and worked well without the patch, so I did not even try to apply it. Thank you very much and sorry for taking so much time to test it, Mikel Garai