mirror of
https://github.com/pumpitupdev/pumptools.git
synced 2026-09-29 10:18:14 +03:00
PR #86 derives the mapping-file directory from dladdr's dli_fname. The initial implementation assumes that the resolved name contains a directory separator. If the loader returns a bare soname, the truncation loop reduces it to its first character and reports success, causing a bogus mapping-file lookup instead of using the executable-directory fallback. Locate the final separator before copying, preserve the filesystem root, reject names that do not identify a directory, and validate the length of the returned directory rather than requiring room for the complete library filename. Link the four PIUIO and PIUBTN keyboard and joystick targets directly with libdl so their dladdr dependency remains explicit on the supported older glibc environment.