Apache OpenOffice (AOO) Bugzilla – Issue 67806
dmake's internal echo command omits/looses spaces in output
Last modified: 2013-08-07 15:34:52 UTC
First of all only the native Windows dmake version knows of the undocumented internal echo and noop commands. They only work in recipe lines that are not executed in a shell (no '+' or shellmetas involved) I'm currently including them for the *nix version of dmake but I found that echo is slightly broken in the native Windows version. Example: --- makefile.mk --- SHELL:=cmd.exe SHELLFLAGS:=/C all : echo "AAA BBB" --- makefile.mk --- $ ./dmake/dmake.exe -r echo "AAA BBB" "AAABBB" Not surprisingly the " quotes are not handled, and I wouldn't change that, but the whitespace between the "parameters" is removed. There is a bug in the runargv function and it would be easy to restore one space between the parameters but I would prefer that everything behind a leading "echo [-n ]" is printed literally. @ause: Is the current broken functionality used somewhere in the OOo build?
Created attachment 38058 [details] Patch for dmake
The previous patch changes the internal echo command to echo [-n] expression that prints expression with all leading whitespaces removed but otherwise unchanged to stdout. The patch also moves the global variable Packed_shell to msdos/runargv.c and msdos/spawn.c as it is used nowhere else. Committed to dmake46.
Tested with the following makefile: --- makefile.mk --- SHELL:=cmd.exe SHELLFLAGS:=/C all : # Print ABC D @echo -n AB @echo C D @echo echo "AAA BBB" # Test empty line $(NULL) # Test empty line in shell +$(NULL) +echo 1234 +$(NULL) +echo asdf # Test noop echo +echo test noop @noop bla bla $(assign AA:=ABC) @echo $(AA) --- makefile.mk --- `dmake -r` seems to work as expected. @ause: Please verify.
created followup #i69536#
.