--- std/format.d.orig Thu Jan 27 01:05:34 2005 +++ std/format.d Thu Feb 3 11:55:06 2005 @@ -96,7 +96,7 @@ * This is the core workhorse routine for all the various formatters. */ -void doFormat(void delegate(dchar) putc, TypeInfo[] arguments, va_list argptr) +void doFormat(void delegate(dchar) putc, TypeInfo[] arguments, va_list argptr, bool ignorePercent = false) { int j; TypeInfo ti; Mangle m; @@ -566,6 +566,13 @@ formatArg('s'); continue; } + + if (ignorePercent) + { + foreach(dchar c; fmt) + putc(c); + return; + } for (size_t i = 0; i < fmt.length; ) { dchar c = fmt[i++]; --- std/stdio.d.orig Thu Jan 27 01:05:34 2005 +++ std/stdio.d Thu Feb 3 11:54:42 2005 @@ -40,7 +40,7 @@ void __fp_unlock(FILE* fp) { } } -private void writex(FILE* fp, TypeInfo[] arguments, void* argptr, int newline) +private void writex(FILE* fp, TypeInfo[] arguments, void* argptr, bit newline, bit format) { int orientation; orientation = fwide(fp, 0); @@ -69,7 +69,7 @@ } } - std.format.doFormat(&putc, arguments, argptr); + std.format.doFormat(&putc, arguments, argptr, !format); if (newline) FPUTC('\n', fp); } @@ -106,7 +106,7 @@ static assert(0); } - std.format.doFormat(&putcw, arguments, argptr); + std.format.doFormat(&putcw, arguments, argptr, !format); if (newline) FPUTWC('\n', fp); } @@ -120,21 +120,41 @@ void writef(...) { - writex(stdout, _arguments, _argptr, 0); + writex(stdout, _arguments, _argptr, 0, 1); } void writefln(...) { - writex(stdout, _arguments, _argptr, 1); + writex(stdout, _arguments, _argptr, 1, 1); +} + +void write(...) +{ + writex(stdout, _arguments, _argptr, 0, 0); +} + +void writeln(...) +{ + writex(stdout, _arguments, _argptr, 1, 0); } void fwritef(FILE* fp, ...) { - writex(fp, _arguments, _argptr, 0); + writex(fp, _arguments, _argptr, 0, 1); } void fwritefln(FILE* fp, ...) { - writex(fp, _arguments, _argptr, 1); + writex(fp, _arguments, _argptr, 1, 1); +} + +void fwrite(FILE* fp, ...) +{ + writex(fp, _arguments, _argptr, 0, 0); +} + +void fwriteln(FILE* fp, ...) +{ + writex(fp, _arguments, _argptr, 1, 0); }