about summary refs log tree commit diff
path: root/users/sterni
diff options
context:
space:
mode:
Diffstat (limited to 'users/sterni')
-rw-r--r--users/sterni/mblog/mblog.lisp16
-rw-r--r--users/sterni/mblog/packages.lisp1
2 files changed, 16 insertions, 1 deletions
diff --git a/users/sterni/mblog/mblog.lisp b/users/sterni/mblog/mblog.lisp
index 1f971bc121d2..4ca0df2392a1 100644
--- a/users/sterni/mblog/mblog.lisp
+++ b/users/sterni/mblog/mblog.lisp
@@ -1,7 +1,23 @@
+;; SPDX-License-Identifier: MIT AND LGPL-2.1-or-later
+;; SPDX-FileCopyrightText: Copyright (C) 2006-2010 by Walter C. Pelissero
+;; SPDX-FileCopyrightText: Copyright (C) 2022 by sterni
 (in-package :mblog)
 
 ;; util
 
+;; Taken from SCLF, written by Walter C. Pelissero
+(defun pathname-as-directory (pathname)
+  "Converts PATHNAME to directory form and return it."
+  (setf pathname (pathname pathname))
+  (if (pathname-name pathname)
+      (make-pathname :directory (append (or (pathname-directory pathname)
+                                            '(:relative))
+                                        (list (file-namestring pathname)))
+                     :name nil
+                     :type nil
+                     :defaults pathname)
+      pathname))
+
 (defmacro with-overwrite-file ((&rest args) &body body)
   "Like WITH-OPEN-FILE, but creates/supersedes the given file for writing."
   `(with-open-file (,@args :direction :output
diff --git a/users/sterni/mblog/packages.lisp b/users/sterni/mblog/packages.lisp
index e4fcb4672828..7fe329372dea 100644
--- a/users/sterni/mblog/packages.lisp
+++ b/users/sterni/mblog/packages.lisp
@@ -36,7 +36,6 @@
    :note)
   (:export :build-mblog)
   (:import-from :local-time :universal-to-timestamp)
-  (:import-from :sclf :pathname-as-directory)
   (:shadowing-import-from :common-lisp :list))
 
 (defpackage :cli