ambrevar: Patch magicffi to support wildcards.
parent
f68056ae31
commit
43f674f710
|
@ -2,4 +2,5 @@
|
||||||
|
|
||||||
(defsystem "ambrevar"
|
(defsystem "ambrevar"
|
||||||
:class :package-inferred-system
|
:class :package-inferred-system
|
||||||
:depends-on ("ambrevar/all"))
|
:depends-on ("ambrevar/all")
|
||||||
|
:components ((:file "patch-magicffi")))
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
(in-package :magicffi)
|
||||||
|
|
||||||
|
(defun path-string (path)
|
||||||
|
(uiop:unix-namestring
|
||||||
|
(uiop:truename* (if (pathnamep path)
|
||||||
|
path
|
||||||
|
(uiop:parse-native-namestring path)))))
|
||||||
|
|
||||||
|
;; Original function uses %truename which fails on wildcards.
|
||||||
|
(defun magic-file (magic pathspec)
|
||||||
|
"Returns a textual description of the contents of the PATHSPEC
|
||||||
|
argument. PATHSPEC is a pathname designator. An error of type
|
||||||
|
MAGIC-ERROR is signaled on failure."
|
||||||
|
(or (foreign-funcall "magic_file"
|
||||||
|
cmagic magic
|
||||||
|
:string (path-string pathspec)
|
||||||
|
:string)
|
||||||
|
(magic-error magic)))
|
Loading…
Reference in New Issue