diff options
| author | Ophestra <cat@gensokyo.uk> | 2024-12-26 16:53:01 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2024-12-26 16:53:01 +0900 |
| commit | b956ce405219993ab4d881cf4a671ecd510f8548 (patch) | |
| tree | 367adcec3bf1ecc32909ed9f83a6e42d4ccc9c0f /ldd/ldd.go | |
| parent | dc579dc610e484e40b57951e8f82580c8b711eca (diff) | |
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>
Diffstat (limited to 'ldd/ldd.go')
| -rw-r--r-- | ldd/ldd.go | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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: |
