diff options
author | Gabriel Scherer <gabriel.scherer@gmail.com> | 2014-05-12 15:38:10 +0000 |
---|---|---|
committer | Gabriel Scherer <gabriel.scherer@gmail.com> | 2014-05-12 15:38:10 +0000 |
commit | 3cb315b6fcc241c44949dd77f97734b1488f2239 (patch) | |
tree | f4b99ade816d810a5f40c6ca584af09af9d8f62f | |
parent | 42aca981e299f70069a918f9605b5a58b6e27b55 (diff) |
fix printing bug: (Printf.printf "% 04d" 3) => "00 3"
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14828 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r-- | stdlib/camlinternalFormat.ml | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/stdlib/camlinternalFormat.ml b/stdlib/camlinternalFormat.ml index e4119b6fd..66af4a7cf 100644 --- a/stdlib/camlinternalFormat.ml +++ b/stdlib/camlinternalFormat.ml @@ -820,7 +820,7 @@ let fix_padding padty width str = begin match padty with | Left -> String.blit str 0 res 0 len | Right -> String.blit str 0 res (width - len) len - | Zeros when len > 0 && (str.[0] = '+' || str.[0] = '-') -> + | Zeros when len > 0 && (str.[0] = '+' || str.[0] = '-' || str.[0] = ' ') -> Bytes.set res 0 str.[0]; String.blit str 1 res (width - len + 1) (len - 1) | Zeros when len > 1 && str.[0] = '0' && (str.[1] = 'x' || str.[1] = 'X') -> |