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 <cat@gensokyo.uk>
This commit is contained in:
parent
dc579dc610
commit
b956ce4052
@ -32,7 +32,7 @@ func Parse(stdout fmt.Stringer) ([]*Entry, error) {
|
|||||||
switch len(segment) {
|
switch len(segment) {
|
||||||
case 2: // /lib/ld-musl-x86_64.so.1 (0x7f04d14ef000)
|
case 2: // /lib/ld-musl-x86_64.so.1 (0x7f04d14ef000)
|
||||||
iL = 1
|
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)
|
case 4: // libc.musl-x86_64.so.1 => /lib/ld-musl-x86_64.so.1 (0x7f04d14ef000)
|
||||||
iL = 3
|
iL = 3
|
||||||
if segment[1] != "=>" {
|
if segment[1] != "=>" {
|
||||||
@ -42,7 +42,7 @@ func Parse(stdout fmt.Stringer) ([]*Entry, error) {
|
|||||||
return nil, ErrPathNotAbsolute
|
return nil, ErrPathNotAbsolute
|
||||||
}
|
}
|
||||||
result[i] = &Entry{
|
result[i] = &Entry{
|
||||||
Name: segment[0],
|
Name: strings.TrimSpace(segment[0]),
|
||||||
Path: segment[2],
|
Path: segment[2],
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user