1
0
Fork 0

- fixed error with foreign memory when calling FFI 'realpath'.

This commit is contained in:
cage 2024-06-01 17:24:33 +02:00
parent e5c7929166
commit 6e1274faf2
1 changed files with 4 additions and 2 deletions

View File

@ -311,8 +311,10 @@ symbolic link."
"NB: returns `PATH` if the FFI call to `realpath` returns NULL."
(let ((absolute-path (let ((resolved ""))
(cffi:with-foreign-string (ptr-path path)
(cffi:with-foreign-string (ptr-resolved resolved)
(ffi-realpath ptr-path ptr-resolved))))))
(setf resolved
(cffi:with-foreign-pointer-as-string (ptr-resolved 4096)
(ffi-realpath ptr-path ptr-resolved))))
resolved)))
(cond
((null absolute-path)
path)