summaryrefslogtreecommitdiffstats
path: root/printf.scm
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:36 -0800
committerBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:36 -0800
commit5bea21e81ed516440e34e480f2c33ca41aa8c597 (patch)
tree653ace1b8fe0a9916d861d35ff8f611b46c80d37 /printf.scm
parent237c6e380aebdcbc70bd1c9ecf7d3f6effca2752 (diff)
downloadslib-5bea21e81ed516440e34e480f2c33ca41aa8c597.tar.gz
slib-5bea21e81ed516440e34e480f2c33ca41aa8c597.zip
Import Upstream version 3a4upstream/3a4
Diffstat (limited to 'printf.scm')
-rw-r--r--printf.scm14
1 files changed, 7 insertions, 7 deletions
diff --git a/printf.scm b/printf.scm
index 28bca59..a85471f 100644
--- a/printf.scm
+++ b/printf.scm
@@ -408,7 +408,7 @@
((case fc
((#\-) (set! left-adjust #t) #f)
((#\+) (set! signed #t) #f)
- ((#\ ) (set! blank #t) #f)
+ ((#\space) (set! blank #t) #f)
((#\#) (set! alternate-form #t) #f)
((#\0) (set! leading-0s #t) #f)
(else #t)))
@@ -454,18 +454,18 @@
((<= width (string-length s)) s)
(left-adjust
(list
- s (make-string (- width (string-length s)) #\ )))
+ s (make-string (- width (string-length s)) #\space)))
(else
(list
(make-string (- width (string-length s))
- (if leading-0s #\0 #\ ))
+ (if leading-0s #\0 #\space))
s))))
(loop (cdr args)))))
;; SLIB extension
((#\a #\A) ;#\a #\A are pretty-print
- (require 'generic-write)
(let ((os "") (pr precision))
+ (require 'generic-write)
(generic-write
(car args) (not alternate-form) #f
(cond ((and left-adjust (negative? pr))
@@ -502,15 +502,15 @@
(positive? sl)))))
(cond ((and left-adjust (negative? precision))
(cond
- ((> width pr) (out (make-string (- width pr) #\ )))))
+ ((> width pr) (out (make-string (- width pr) #\space)))))
(left-adjust
(cond
((> width (- precision pr))
- (out (make-string (- width (- precision pr)) #\ )))))
+ (out (make-string (- width (- precision pr)) #\space)))))
((not os))
((<= width (string-length os)) (out os))
(else (and (out (make-string
- (- width (string-length os)) #\ ))
+ (- width (string-length os)) #\space))
(out os)))))
(loop (cdr args)))
((#\d #\D #\i #\I #\u #\U)