From b956ce405219993ab4d881cf4a671ecd510f8548 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Thu, 26 Dec 2024 16:53:01 +0900 Subject: ldd: trim leading and trailing white spaces from name Glibc emits ldd output with \t prefix for formatting. Remove that here. Signed-off-by: Ophestra --- ldd/ldd.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ldd/ldd.go') diff --git a/ldd/ldd.go b/ldd/ldd.go index 2862dab3..434fbab6 100644 --- a/ldd/ldd.go +++ b/ldd/ldd.go @@ -32,7 +32,7 @@ func Parse(stdout fmt.Stringer) ([]*Entry, error) { switch len(segment) { case 2: // /lib/ld-musl-x86_64.so.1 (0x7f04d14ef000) iL = 1 - result[i] = &Entry{Name: segment[0]} + result[i] = &Entry{Name: strings.TrimSpace(segment[0])} case 4: // libc.musl-x86_64.so.1 => /lib/ld-musl-x86_64.so.1 (0x7f04d14ef000) iL = 3 if segment[1] != "=>" { @@ -42,7 +42,7 @@ func Parse(stdout fmt.Stringer) ([]*Entry, error) { return nil, ErrPathNotAbsolute } result[i] = &Entry{ - Name: segment[0], + Name: strings.TrimSpace(segment[0]), Path: segment[2], } default: -- cgit v1.3.1