From f8d720b1510f12e62e0fdf279bf9d6648666b5af Mon Sep 17 00:00:00 2001
From: Francois-Rene Rideau <tunes@google.com>
Date: Fri, 14 Oct 2011 03:56:05 -0400
Subject: [PATCH] Fix strip/

---
 asdf-dependency-grovel.asd | 8 ++++++--
 grovel.lisp                | 8 ++++----
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/asdf-dependency-grovel.asd b/asdf-dependency-grovel.asd
index 78f18fa..bc03b9d 100644
--- a/asdf-dependency-grovel.asd
+++ b/asdf-dependency-grovel.asd
@@ -1,6 +1,10 @@
 ;;; -*- Mode: Lisp -*-
 
-(cl:in-package #:asdf)
+(cl:in-package :asdf)
+
+(unless (or #+asdf2 (asdf:version-satisfies (asdf:asdf-version) "2.014.8"))
+  (error "Not only is your ASDF version is too old for ASDF-DEPENDENCY-GROVEL,
+	you must upgrade it *before* you try to load any system."))
 
 (defclass grovel-handlers (module)
      ((%components :accessor %handler-components)))
@@ -26,7 +30,7 @@
             (handler-input-file-list (component-pathname c) c))))
 
 (defsystem :asdf-dependency-grovel
-  ;; :depends-on (:asdf) ; not safe. ASDF must be explicitly upgraded in advance.
+  :depends-on ((:version :asdf "2.017"))
   :components ((:file "package")
                (:file "variables" :depends-on ("package"))
                (:file "classes" :depends-on ("package" "variables"))
diff --git a/grovel.lisp b/grovel.lisp
index 3924461..c1162e5 100644
--- a/grovel.lisp
+++ b/grovel.lisp
@@ -500,10 +500,10 @@
 (defun strip/ (name)
   (subseq name (1+ (or (position #\/ name :from-end t) -1))))
 (defun strip-extension (name extension)
-  (let* ((lext (length extension))
-         (lnam (length name))
-         (pos (- lnam lext)))
-    (if (and (plusp lext)
+  (let* ((lext (and (stringp extension) (length extension)))
+         (pext (and lext (plusp lext)))
+         (pos (and pext (- (length name) lext))))
+    (if (and pos
              (< 1 pos)
              (string= name extension :start1 pos)
              (eql #\. (char name (1- pos))))
-- 
GitLab