Skip to content
Snippets Groups Projects
Commit 0e3a6181 authored by rtoy's avatar rtoy
Browse files

Signal an error when trying to create a namestring if the name or type

component contains a "/" or "." because we can't print these readably.
parent 7f9451ca
No related branches found
No related tags found
No related merge requests found
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu. ;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;; ;;;
(ext:file-comment (ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/filesys.lisp,v 1.96 2005/10/22 00:33:56 rtoy Exp $") "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/filesys.lisp,v 1.97 2005/11/04 14:22:43 rtoy Exp $")
;;; ;;;
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
...@@ -490,10 +490,23 @@ ...@@ -490,10 +490,23 @@
'(:newest '(:newest
:unspecific))))))) :unspecific)))))))
(when name (when name
(when (stringp name)
(when (find #\/ name)
(error "Cannot specify a directory separator in a pathname name: ~S" name))
(when (find #\. name)
(error "Cannot specify a dot in a pathname name: ~S" name))
(when (or (string= ".." name)
(string= "." name))
(error "Invalid value for a pathname name: ~S" name)))
(strings (unparse-unix-piece name))) (strings (unparse-unix-piece name)))
(when type-supplied (when type-supplied
(unless name (unless name
(error "Cannot specify the type without a file: ~S" pathname)) (error "Cannot specify the type without a file: ~S" pathname))
(when (stringp type)
(when (find #\/ type)
(error "Cannot specify a directory separator in a pathname type: ~S" type))
(when (find #\. type)
(error "Cannot specify a dot in a pathname type: ~S" type)))
(strings ".") (strings ".")
(strings (unparse-unix-piece type))) (strings (unparse-unix-piece type)))
(when (and (not (member version '(nil :newest :unspecific))) (when (and (not (member version '(nil :newest :unspecific)))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment