* [PATCH libnetfilter_queue] build: add missing backslash to build_man.sh
@ 2024-10-04 4:06 Duncan Roe
2024-10-04 13:18 ` Phil Sutter
2024-10-12 10:31 ` Phil Sutter
0 siblings, 2 replies; 7+ messages in thread
From: Duncan Roe @ 2024-10-04 4:06 UTC (permalink / raw)
To: pablo; +Cc: netfilter-devel
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: 6d17e6daa175
Signed-off-by: Duncan Roe <duncan_roe@optusnet.com.au>
---
doxygen/build_man.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doxygen/build_man.sh b/doxygen/build_man.sh
index c0124e2..8f1852a 100755
--- a/doxygen/build_man.sh
+++ b/doxygen/build_man.sh
@@ -43,7 +43,7 @@ rename_real_pages(){
do
j=$(ed -s $i <<////
/Functions/+1;.#
-/^\.RI/;.#
+/^\\.RI/;.#
.,.s/^.*\\\\fB//
.,.s/\\\\.*//
.,.w /dev/stdout
--
2.39.4
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH libnetfilter_queue] build: add missing backslash to build_man.sh
2024-10-04 4:06 [PATCH libnetfilter_queue] build: add missing backslash to build_man.sh Duncan Roe
@ 2024-10-04 13:18 ` Phil Sutter
2024-10-06 23:52 ` Duncan Roe
2024-10-12 10:31 ` Phil Sutter
1 sibling, 1 reply; 7+ messages in thread
From: Phil Sutter @ 2024-10-04 13:18 UTC (permalink / raw)
To: Duncan Roe; +Cc: pablo, netfilter-devel
Hi Duncan,
On Fri, Oct 04, 2024 at 02:06:39PM +1000, Duncan Roe wrote:
> 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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH libnetfilter_queue] build: add missing backslash to build_man.sh
2024-10-04 13:18 ` Phil Sutter
@ 2024-10-06 23:52 ` Duncan Roe
2024-10-07 12:24 ` Phil Sutter
0 siblings, 1 reply; 7+ messages in thread
From: Duncan Roe @ 2024-10-06 23:52 UTC (permalink / raw)
To: Phil Sutter; +Cc: Pablo Neira Ayuso, Netfilter Development
Hi Phil,
On Fri, Oct 04, 2024 at 03:18:28PM +0200, Phil Sutter wrote:
> 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.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH libnetfilter_queue] build: add missing backslash to build_man.sh
2024-10-06 23:52 ` Duncan Roe
@ 2024-10-07 12:24 ` Phil Sutter
2024-10-07 22:50 ` Duncan Roe
2024-10-12 4:08 ` Duncan Roe
0 siblings, 2 replies; 7+ messages in thread
From: Phil Sutter @ 2024-10-07 12:24 UTC (permalink / raw)
To: Pablo Neira Ayuso, Netfilter Development
Hi Duncan,
On Mon, Oct 07, 2024 at 10:52:54AM +1100, Duncan Roe wrote:
> On Fri, Oct 04, 2024 at 03:18:28PM +0200, Phil Sutter wrote:
> > 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?
> 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.
Sure!
> 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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH libnetfilter_queue] build: add missing backslash to build_man.sh
2024-10-07 12:24 ` Phil Sutter
@ 2024-10-07 22:50 ` Duncan Roe
2024-10-12 4:08 ` Duncan Roe
1 sibling, 0 replies; 7+ messages in thread
From: Duncan Roe @ 2024-10-07 22:50 UTC (permalink / raw)
To: Phil Sutter; +Cc: Pablo Neira Ayuso, Netfilter Development
On Mon, Oct 07, 2024 at 02:24:27PM +0200, Phil Sutter wrote:
> 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.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH libnetfilter_queue] build: add missing backslash to build_man.sh
2024-10-07 12:24 ` Phil Sutter
2024-10-07 22:50 ` Duncan Roe
@ 2024-10-12 4:08 ` Duncan Roe
1 sibling, 0 replies; 7+ messages in thread
From: Duncan Roe @ 2024-10-12 4:08 UTC (permalink / raw)
To: Phil Sutter; +Cc: Pablo Neira Ayuso, Netfilter Development
Hi Phil,
On Mon, Oct 07, 2024 at 02:24:27PM +0200, Phil Sutter wrote:
> On Mon, Oct 07, 2024 at 10:52:54AM +1100, Duncan Roe wrote:
> > 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.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH libnetfilter_queue] build: add missing backslash to build_man.sh
2024-10-04 4:06 [PATCH libnetfilter_queue] build: add missing backslash to build_man.sh Duncan Roe
2024-10-04 13:18 ` Phil Sutter
@ 2024-10-12 10:31 ` Phil Sutter
1 sibling, 0 replies; 7+ messages in thread
From: Phil Sutter @ 2024-10-12 10:31 UTC (permalink / raw)
To: Duncan Roe; +Cc: pablo, netfilter-devel
On Fri, Oct 04, 2024 at 02:06:39PM +1000, Duncan Roe wrote:
> 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: 6d17e6daa175
> Signed-off-by: Duncan Roe <duncan_roe@optusnet.com.au>
Patch applied, thanks!
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-10-12 10:31 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-04 4:06 [PATCH libnetfilter_queue] build: add missing backslash to build_man.sh Duncan Roe
2024-10-04 13:18 ` Phil Sutter
2024-10-06 23:52 ` Duncan Roe
2024-10-07 12:24 ` Phil Sutter
2024-10-07 22:50 ` Duncan Roe
2024-10-12 4:08 ` Duncan Roe
2024-10-12 10:31 ` Phil Sutter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).