summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Faulhaber <git_net@infolace.com>2011-03-05 21:58:11 -0800
committerStuart Halloway <stu@thinkrelevance.com>2011-04-08 10:00:02 -0400
commitf0a46155ba3b7243477515613573c6217c0291ab (patch)
tree8cd73ed9846fde45218f24680f4e38b70204276e /src
parentdd49d07b75c619075156d1b38bae9a364ffb63b1 (diff)
Fix handling of the ~:(~) directive when the contents are the empty string. Refs #751
Signed-off-by: Stuart Halloway <stu@thinkrelevance.com>
Diffstat (limited to 'src')
-rw-r--r--src/clj/clojure/pprint/cl_format.clj9
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)]