* [LTP] [PATCH] nm01: fix regex matching internal symbols
@ 2020-05-08 12:58 Jan Stancek
2020-05-10 8:21 ` Petr Vorel
0 siblings, 1 reply; 3+ messages in thread
From: Jan Stancek @ 2020-05-08 12:58 UTC (permalink / raw)
To: ltp
Current regex matches any word character followed by space
and one of letters "abdft". So it doesn't match only symbol type,
but can match for example value and size:
$ grep "\w [a,b,d,f,t]" nm.out
__libc_csu_init T 10000640 b4
matches ^ ^
Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
testcases/commands/nm/nm01.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/testcases/commands/nm/nm01.sh b/testcases/commands/nm/nm01.sh
index fd9d3d92262f..873126d20945 100755
--- a/testcases/commands/nm/nm01.sh
+++ b/testcases/commands/nm/nm01.sh
@@ -47,7 +47,7 @@ test2()
{
EXPECT_PASS $NM -f posix -g $TST_DATAROOT/f1 \> nm.out
- if grep -q "\w [a,b,d,f,t]" nm.out; then
+ if grep -q "^[^ ]\+ [abdft]" nm.out; then
tst_res TFAIL "Got internal symbols with -g"
cat nm.out
else
--
2.18.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [LTP] [PATCH] nm01: fix regex matching internal symbols
2020-05-08 12:58 [LTP] [PATCH] nm01: fix regex matching internal symbols Jan Stancek
@ 2020-05-10 8:21 ` Petr Vorel
2020-05-11 6:33 ` Li Wang
0 siblings, 1 reply; 3+ messages in thread
From: Petr Vorel @ 2020-05-10 8:21 UTC (permalink / raw)
To: ltp
> Current regex matches any word character followed by space
> and one of letters "abdft". So it doesn't match only symbol type,
> but can match for example value and size:
> $ grep "\w [a,b,d,f,t]" nm.out
> __libc_csu_init T 10000640 b4
> matches ^ ^
> Signed-off-by: Jan Stancek <jstancek@redhat.com>
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Good catch, Jan.
Kind regards,
Petr
^ permalink raw reply [flat|nested] 3+ messages in thread
* [LTP] [PATCH] nm01: fix regex matching internal symbols
2020-05-10 8:21 ` Petr Vorel
@ 2020-05-11 6:33 ` Li Wang
0 siblings, 0 replies; 3+ messages in thread
From: Li Wang @ 2020-05-11 6:33 UTC (permalink / raw)
To: ltp
On Sun, May 10, 2020 at 4:22 PM Petr Vorel <pvorel@suse.cz> wrote:
> > Current regex matches any word character followed by space
> > and one of letters "abdft". So it doesn't match only symbol type,
> > but can match for example value and size:
> > $ grep "\w [a,b,d,f,t]" nm.out
> > __libc_csu_init T 10000640 b4
> > matches ^ ^
>
> > Signed-off-by: Jan Stancek <jstancek@redhat.com>
> Reviewed-by: Petr Vorel <pvorel@suse.cz>
> Good catch, Jan.
>
Tested and pushed.
--
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20200511/d55a97d0/attachment.htm>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-05-11 6:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-08 12:58 [LTP] [PATCH] nm01: fix regex matching internal symbols Jan Stancek
2020-05-10 8:21 ` Petr Vorel
2020-05-11 6:33 ` Li Wang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.