Bug 15663 – writefln("%#o", 0) should yield "0" instead of "00"

Status
RESOLVED
Resolution
FIXED
Severity
trivial
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2016-02-09T10:44:00Z
Last change time
2016-02-12T08:43:31Z
Keywords
pull
Assigned to
nobody
Creator
Marco.Leise

Comments

Comment #0 by Marco.Leise — 2016-02-09T10:44:50Z
The #-flag should prefix %o, %x and %X with '0', '0x' and '0X' respectively, IF the input is different from 0. While the hex printout matches printf(), the octal output is "00" instead of "0".
Comment #1 by hsteoh — 2016-02-12T01:31:13Z
Comment #2 by github-bugzilla — 2016-02-12T08:43:31Z
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/4a762a9ae495b0333ea21c9be20ce33746922c14 Fix issue 15663: format("%#o", 0) should be "0" not "00". https://github.com/D-Programming-Language/phobos/commit/51097537bbd4b5bc6d465a18f40ca98210e7087e Merge pull request #3988 from quickfur/issue15663 Fix issue 15663: format("%#o", 0) should be "0" not "00".