nm01: fix regex matching internal symbols
PATCH 1/1 nm01: fix regex matching internal symbols
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 <[email protected]>
--- testcases/commands/nm/nm01.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
testcases/commands/nm/nm01.sh +1 -1
@@ -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
Signature · 1 line
2.18.1
PATCH 1/1 nm01: fix regex matching internal symbols
Quoted 8 lines
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 <[email protected]>
Reviewed-by Petr Vorel <[email protected]>
Good catch, Jan.
Kind regards,
Petr
PATCH 1/1 nm01: fix regex matching internal symbols
Quoted 11 lines · Petr Vorel
Quoted 8 lines
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 <[email protected]>Reviewed-by Petr Vorel <[email protected]>Good catch, Jan.
Tested and pushed.
Signature · 5 lines
Regards, Li Wang -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.linux.it/pipermail/ltp/attachments/20200511/d55a97d0/attachment.htm>