diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/clj/clojure/pprint/cl_format.clj | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/clj/clojure/pprint/cl_format.clj b/src/clj/clojure/pprint/cl_format.clj index 0a74bbd5..ef5c9810 100644 --- a/src/clj/clojure/pprint/cl_format.clj +++ b/src/clj/clojure/pprint/cl_format.clj @@ -1088,10 +1088,11 @@ Note this should only be used for the last one in the sequence" (let [s ^String x] (.write writer ^String (capitalize-string (.toLowerCase s) @last-was-whitespace?)) - (dosync - (ref-set last-was-whitespace? - (Character/isWhitespace - ^Character (nth s (dec (count s))))))) + (when (pos? (.length s)) + (dosync + (ref-set last-was-whitespace? + (Character/isWhitespace + ^Character (nth s (dec (count s)))))))) Integer (let [c (char x)] |