From a4e33b7683a15bccdf944729b5c1fcb5a81970cf Mon Sep 17 00:00:00 2001
From: Raymond Toy <toy.raymond@gmail.com>
Date: Thu, 8 Dec 2011 10:22:32 -0800
Subject: [PATCH] Fix ticket:50

Check if "" (and "/") is in the list of directories and signal an
error so that we use the #P(...) syntax to print out the pathname
readably.

Update the pot and po files accordingly.
---
 src/code/filesys.lisp                         |  9 +++-
 src/i18n/locale/cmucl.pot                     | 18 +++++++-
 .../locale/en@piglatin/LC_MESSAGES/cmucl.po   | 43 +++++++++++++++----
 src/i18n/locale/ko/LC_MESSAGES/cmucl.po       | 18 +++++++-
 4 files changed, 77 insertions(+), 11 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 ""
diff --git a/src/i18n/locale/en@piglatin/LC_MESSAGES/cmucl.po b/src/i18n/locale/en@piglatin/LC_MESSAGES/cmucl.po
index 78da94f62..37c3afec6 100644
--- a/src/i18n/locale/en@piglatin/LC_MESSAGES/cmucl.po
+++ b/src/i18n/locale/en@piglatin/LC_MESSAGES/cmucl.po
@@ -12874,15 +12874,16 @@ 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 ""
-"Onvertcay Ingstray otay octetsway usingway ethay ecifiedspay Externalway-"
-"ormatfay.  Ethay\n"
-"  ingstray isway oundedbay ybay Tartsay (efaultingday otay 0) andway Endway "
-"(efaultingday otay\n"
-"  ethay endway ofway ethay ingstray.  Ifway Ufferbay isway ivengay, ethay "
-"octetsway areway toredsay\n"
-"  erethay.  Ifway otnay, away ewnay ufferbay isway eatedcray."
 
 #: src/code/extfmts.lisp
 msgid ""
@@ -13989,6 +13990,18 @@ msgstr "Invalidway atternpay iecepay: ~S"
 msgid ":BACK cannot be represented in namestrings."
 msgstr ":BACK annotcay ebay epresentedray inway amestringsnay."
 
+#: src/code/filesys.lisp
+#, fuzzy
+msgid "Cannot represent \"\" in namestrings."
+msgstr ":BACK annotcay ebay epresentedray inway amestringsnay."
+
+#: src/code/filesys.lisp
+#, fuzzy
+msgid "Cannot represent an explicit directory separator in namestrings."
+msgstr ""
+"Annotcay ecifyspay away irectoryday eparatorsay inway away athnamepay "
+"amenay: ~S"
+
 #: src/code/filesys.lisp
 msgid "Cannot specify a directory separator in a pathname name: ~S"
 msgstr ""
@@ -30435,6 +30448,20 @@ msgstr ""
 "Unicodeway\n"
 "eplacementray aracterchay."
 
+#~ 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."
+#~ msgstr ""
+#~ "Onvertcay Ingstray otay octetsway usingway ethay ecifiedspay Externalway-"
+#~ "ormatfay.  Ethay\n"
+#~ "  ingstray isway oundedbay ybay Tartsay (efaultingday otay 0) andway "
+#~ "Endway (efaultingday otay\n"
+#~ "  ethay endway ofway ethay ingstray.  Ifway Ufferbay isway ivengay, ethay "
+#~ "octetsway areway toredsay\n"
+#~ "  erethay.  Ifway otnay, away ewnay ufferbay isway eatedcray."
+
 #~ msgid ""
 #~ "Return a pathname describing what file COMPILE-FILE would write to given\n"
 #~ "   these arguments."
diff --git a/src/i18n/locale/ko/LC_MESSAGES/cmucl.po b/src/i18n/locale/ko/LC_MESSAGES/cmucl.po
index a806becfe..12d0955d5 100644
--- a/src/i18n/locale/ko/LC_MESSAGES/cmucl.po
+++ b/src/i18n/locale/ko/LC_MESSAGES/cmucl.po
@@ -9046,7 +9046,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
@@ -9829,6 +9837,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