build: add missing backslash to build_man.sh
PATCH 1/1 build: add missing backslash to build_man.sh
Search for exact match of ".RI" had a '\' to escape '.' from the regexp parser but was missing another '\' to escape the 1st '\' from shell. Had not yet caused a problem but might as well do things correctly.
--- doxygen/build_man.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
doxygen/build_man.sh +1 -1
@@ -43,7 +43,7 @@ rename_real_pages(){ do j=$(ed -s $i <<//// /Functions/+1;.# -/^\.RI/;.# +/^\\.RI/;.# .,.s/^.*\\\\fB// .,.s/\\\\.*// .,.w /dev/stdout
Signature · 1 line
2.39.4
Phil Sutter
reviewerHi Duncan,
Quoted 3 lines · Duncan Roe
Search for exact match of ".RI" had a '\' to escape '.' from the regexp parser but was missing another '\' to escape the 1st '\' from shell. Had not yet caused a problem but might as well do things correctly.
Your patch looks correct and bash(1) confirms the need for escaping:
"If any part of word is quoted, the delimiter is the result of quote removal on word, and the lines in the here-document are not expanded. If word is unquoted, all lines of the here-document are subjected to parameter expansion, command substitution, and arithmetic expansion, the character sequence \<newline> is ignored, and \ must be used to quote the characters \, $, and `."
This holds another interesting detail, though: By quoting your delimiter, you may disable expansion entirely which might improve readability in those ed commands?
Cheers, Phil
Hi Phil,
Quoted 3 lines · Phil Sutter
This holds another interesting detail, though: By quoting your delimiter, you may disable expansion entirely which might improve readability in those ed commands?
I did try quoting the delimiter when I was working on speeding up build_man.sh. Rather to my surprise, the used CPU went up albeit by a tiny amount. I was absolutely focussed on speed so left the delimiter unquoted.
The CPU increase was so small that you might consider the improvement in readability to be worth it.
But there is another possible downside to quoting the delimiter. Some of the here documents in build_man contain actual parameter substitution so would have to be left as_is, leading to inconsistent appearance of here documents.
I'm happy to do it either way, LMK your preference.
Cheers ... Duncan.
Phil Sutter
reviewerHi Duncan,
Quoted 8 lines · Duncan Roe
Quoted 3 lines · Phil Sutter
This holds another interesting detail, though: By quoting your delimiter, you may disable expansion entirely which might improve readability in those ed commands?
I did try quoting the delimiter when I was working on speeding up
build_man.sh. Rather to my surprise, the used CPU went up albeit by a tiny amount. I was absolutely focussed on speed so left the delimiter unquoted.
That's odd - while the shell will have to unquote the delimiter, it should have less work with the content. Are you sure this is not just noise you were measuring?
Quoted 6 lines
The CPU increase was so small that you might consider the improvement in readability to be worth it.
But there is another possible downside to quoting the delimiter. Some of the here documents in
build_mancontain actual parameter substitution so would have to be leftas_is, leading to inconsistent appearance of here documents.
Sure!
Quoted 1 line
I'm happy to do it either way, LMK your preference.
I don't have any, just stumbled upon this feature when checking for when/why unescaped backslashes are interpreted or not.
Cheers, Phil
Quoted 4 lines · Phil Sutter
That's odd - while the shell will have to unquote the delimiter, it should have less work with the content. Are you sure this is not just noise you were measuring?
It sure surprised the hell out of me. I do know a bit about eperimental technique having studied honours physics, so I reversed the test a few times. The unquoted delimiter was always faster. The difference was very small but statistically significant.
Cheers ... Duncan.
Hi Phil,
Quoted 6 lines · Phil Sutter
Quoted 1 line · Duncan Roe
I'm happy to do it either way, LMK your preference.
I don't have any, just stumbled upon this feature when checking for when/why unescaped backslashes are interpreted or not.
I'll leave it as_is then.
Can somebody please apply this patch?
Cheers ... Duncan.
Phil Sutter
reviewerQuoted 6 lines · Duncan Roe
Search for exact match of ".RI" had a '\' to escape '.' from the regexp parser but was missing another '\' to escape the 1st '\' from shell. Had not yet caused a problem but might as well do things correctly.
Fixes 6d17e6daa175Signed-off-by Duncan Roe <[email protected]>
Patch applied, thanks!