diff options
author | Alejandro Colomar <alx.manpages@gmail.com> | 2021-05-23 13:50:15 +0200 |
---|---|---|
committer | Alejandro Colomar <alx.manpages@gmail.com> | 2022-02-25 16:29:47 +0100 |
commit | 000f0269b7063591070af3ee098980923ffb01da (patch) | |
tree | 4955930e619dfc2c605b736cb35690b16c1b172f /scripts | |
parent | 7e1dbe0b11a5f1c12ab9ae70aa1df3e344ed58ab (diff) |
scripts/bash_aliases: man_lsfunc(): Fix some corner cases
Although 'int foo(...);' is not a valid C prototype, we use it in
one manual page: sigreturn(2). Fix man_lsfunc() to find that
prototype.
When a syscall(SYS_...) function doesn't have any arguments
(except for the SYS_* constant), there's not a comma between the
parentheses. Adapt the regex for that.
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/bash_aliases | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/bash_aliases b/scripts/bash_aliases index b13dfacae..b7a484e32 100644 --- a/scripts/bash_aliases +++ b/scripts/bash_aliases @@ -137,9 +137,9 @@ function man_lsfunc() man_section "${arg}" 'SYNOPSIS'; done \ |sed_rm_ccomments \ - |pcregrep -Mn '(?s)^ [\w ]+ \**\w+\([\w\s(,)[\]*]+?(...)?\s*\); *$' \ + |pcregrep -Mn '(?s)^ [\w ]+ \**\w+\([\w\s(,)[\]*]*?(...)?\s*\); *$' \ |grep '^[0-9]' \ - |sed 's/syscall(SYS_\(\w*\),/\1(/' \ + |sed -E 's/syscall\(SYS_(\w*),?/\1(/' \ |sed -E 's/^[^(]+ \**(\w+)\(.*/\1/' \ |uniq; } |