From 2a93478cc3f27b51eab5cf03a369c3be3198ecd7 Mon Sep 17 00:00:00 2001 From: Raymond Toy <rtoy@google.com> Date: Thu, 8 Dec 2011 09:55:36 -0800 Subject: [PATCH] Fix ticket:50 Catch the case of " " and signal an error so that we can print such pathnames using the #P(...) syntax. Also catch the case where the directory includes an explicit directory separator, "/", which would not be printed readably either. Update the pot file too. --- src/code/filesys.lisp | 9 ++++++++- src/i18n/locale/cmucl.pot | 18 +++++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/code/filesys.lisp b/src/code/filesys.lisp index ab2f564b8..308b8b542 100644 --- a/src/code/filesys.lisp +++ b/src/code/filesys.lisp @@ -488,7 +488,14 @@ (error (intl:gettext ":BACK cannot be represented in namestrings."))) ((member :wild-inferiors) (pieces "**/")) - ((or simple-string pattern (eql :wild)) + (simple-string + (when (zerop (length dir)) + (error (intl:gettext "Cannot represent \"\" in namestrings."))) + (when (string-equal dir "/") + (error (intl:gettext "Cannot represent an explicit directory separator in namestrings."))) + (pieces (unparse-unix-piece dir)) + (pieces "/")) + ((or pattern (eql :wild)) (pieces (unparse-unix-piece dir)) (pieces "/")) (t diff --git a/src/i18n/locale/cmucl.pot b/src/i18n/locale/cmucl.pot index 92ace3df8..a1087ca86 100644 --- a/src/i18n/locale/cmucl.pot +++ b/src/i18n/locale/cmucl.pot @@ -9026,7 +9026,15 @@ msgid "" "Convert String to octets using the specified External-format. The\n" " string is bounded by Start (defaulting to 0) and End (defaulting to\n" " the end of the string. If Buffer is given, the octets are stored\n" -" there. If not, a new buffer is created." +" there. If not, a new buffer is created. Buffer-start specifies\n" +" where in the buffer the first octet will be placed.\n" +"\n" +" Three values are returned: The buffer, the number of valid octets\n" +" written, and the number of characters converted. Note that the\n" +" actual number of octets written may be greater than the returned\n" +" value, These represent the partial octets of the next character to\n" +" be converted, but there was not enough room to hold the complete set\n" +" of octets." msgstr "" #: src/code/extfmts.lisp @@ -9806,6 +9814,14 @@ msgstr "" msgid ":BACK cannot be represented in namestrings." msgstr "" +#: src/code/filesys.lisp +msgid "Cannot represent \"\" in namestrings." +msgstr "" + +#: src/code/filesys.lisp +msgid "Cannot represent an explicit directory separator in namestrings." +msgstr "" + #: src/code/filesys.lisp msgid "Cannot specify a directory separator in a pathname name: ~S" msgstr "" -- GitLab