1
0
Fork 0

- added function 'fs:path-referencing-dir-p'.

This commit is contained in:
cage 2022-01-23 13:06:24 +01:00
parent 1d2d528d95
commit 1cf9be1863
5 changed files with 8 additions and 3 deletions

View File

@ -32,7 +32,8 @@
(in-package :modules)
(defparameter *expand-abbrev-rewriting-rules* '(("^!g" "gemini://"))
(defparameter *expand-abbrev-rewriting-rules* '(("^!g" "gemini://")
("^!n" "np://"))
"Before displaying messages that module will rewrites the first
element of each item (a regular expression) of this list with the second

View File

@ -23,7 +23,7 @@
(not dirp))
(list :path path :dirp dirp :markedp nil))
(dirp
(if (scan "/$" path)
(if (fs:path-referencing-dir-p path)
(list :path path :dirp t :markedp nil)
(list :path (strcat path "/") :dirp t :markedp nil)))))

View File

@ -152,6 +152,9 @@
(defun loopback-reference-dir-p (path)
(string= (path-last-element path) "."))
(defun path-referencing-dir-p (path)
(cl-ppcre:scan "/$" path))
(defun collect-files/dirs (root)
(let ((all-files '())
(all-dirs '()))

View File

@ -85,7 +85,7 @@
(assert path)
(with-cloned-root-fid (*stream* root-fid)
(if dirp
(9p:create-path *stream* root-fid (if (cl-ppcre:scan "/$" path)
(9p:create-path *stream* root-fid (if (fs:path-referencing-dir-p path)
path
(text-utils:strcat path "/")))
(9p:create-path *stream* root-fid path))))))

View File

@ -289,6 +289,7 @@
:collect-children
:backreference-dir-p
:loopback-reference-dir-p
:path-referencing-dir-p
:collect-files/dirs
:prepend-pwd
:search-matching-file