Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace base64 dependency with cl-base64 #62

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/crud/crud.asd
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
:depends-on
(#:sucle-serialize
#:sqlite
#:base64
#:cl-base64
#:uiop
#:lparallel
;;For one macro in 'database'
#:alexandria)
:serial t
:components
((:file "database")
(:file "crud")))
(:file "crud")))



Expand Down
12 changes: 4 additions & 8 deletions src/crud/crud.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,10 @@
;;[FIXME]:can possibly create filenames that are illegal.
;;use base64 instead? how to mix the two?
;;
(defparameter *base-64-string*
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_")
(defun string-base64 (string)
(let ((base64::*base64* *base-64-string*))
(base64:base64-encode string)))
(base64:string-to-base64-string string :uri t))
(defun base64-string (string)
(let ((base64::*base64* *base-64-string*))
(base64:base64-decode string)))
(base64:base64-string-to-string string :uri t))
(defun commentify (&optional (string "test"))
(concatenate 'string ";" string))
(defun un-commentify (&optional (string ";test"))
Expand All @@ -116,7 +112,7 @@
directory)))
;;FIXME::This probably won't work on windows.
;;https://stackoverflow.com/questions/4814040/allowed-characters-in-filename

;;Check that they both point to files in same directory
;;If they are, then it is safe
(if (equal (pathname-directory base64-path)
Expand All @@ -129,7 +125,7 @@
(defun crud_read_file-pile (lisp-object &aux (path *path*))
(multiple-value-bind (file-path base64) (%check-safe-string lisp-object path)
;;if both are valid, prefer the base64 one.
;;if only base64 is valid, just use that.
;;if only base64 is valid, just use that.
(sucle-serialize:load
(cond (file-path
(if (probe-file base64)
Expand Down