Apache OpenOffice (AOO) Bugzilla – Issue 46987
$(mktmp ...) works different than documented
Last modified: 2013-08-07 15:34:52 UTC
While looking at issue 43241 I found that $(mktmp ...) is *not* working as the man page describes it: ... The diversion text may contain the same escape codes as those described in the MACROS section. Thus if the data text is to contain new lines they must be inserted using the \n escape sequence. For example the expression: all: cat $(mktmp this is a\n\ test of the text diversion\n) But the documentation is not consistent in this case anyway, the escape codes are only part of the tokenization (:t) macro modifier and are not supported anywhere else. I guess this "feature" was disabled once mktmp was used with DOS filenames and produced surprising results. @hjs: How do we solve this problem? Fix the documentation? (ATM the last line of the generated mktmp file is terminated with a linefeed (issue 15816) and linefeeds in between can be inserted with the :t macro modifier.) P.S.: I could offer to add an evaluate (:v) macro modifier that evaluates escape codes if present.
I take it
Created attachment 24952 [details] Documentation fix for mktmp and new :m macro expansion
Committed to CWS dmake43p01. reassign to verify
vq->hjs: please verify
in this example the tab escape chhar following the newline escapechar is stripped. this might be desireable after line continuation but is surprising in the first line. ----------------------------------------- test:=test1\n\ttes\tt2\n\ test3 all: cat $(mktmp $(test:m))
Hmm, the problem is in the part of the code that I didn't touch. Try: test:=test1\n\ttes\tt2\n\ test3 all: echo "X:$(test:m):Z" and you'll see that the :m is doing the right thing, but $(mktmp is cutting of the leading spaces. OK, to keep the current behaviour and create a new issue with: "function macro mktmp is cutting of leading whitespaces" ?
perfectly fine, just wanted to mention it
.