Commit Graph

11 Commits

Author SHA1 Message Date
Fabian Homborg
0bde698f81 printf: Don't die on incomplete conversions
POSIX dictates here that incomplete conversions, like in

    printf %d\n 15.2

or

    printf %d 14g

are still printed along with any error.

This seems alright, as it allows users to silence stderr to accept incomplete conversions.

This commit implements it, but what's a bit weird is the ordering between stdout and stderr,
causing the error to be printed _after_, like

    15
    14
    15.1: value not completely converted
    14,2: value not completely converted

but that seems like a general issue with how we buffer the streams.

(I know that nonfatal_error is a copy of most of fatal_error - I tried
differently, and va_* is weird)

Fixes #5532.
2019-03-17 17:00:55 +01:00
Kurtis Rader
3d0a377e26 correct printf handling of %x with long ints
Fixes #3352
2017-02-20 17:58:08 -08:00
Kurtis Rader
44cfe3e340 remove dependency on xxd
Fixes #3797
2017-01-31 22:10:53 -08:00
Kurtis Rader
6b1801063b fix raw_string_to_scalar_type locale handling
Fixes #3334
2016-09-02 18:48:16 -07:00
ridiculousfish
d4eded2376 Make octal/hex escapes in printf and echo output literal bytes
Fixes #1894
2015-01-15 11:21:07 -08:00
ridiculousfish
c33a3862cc Disable printf %a test since it has different output on FreeBSD
Fixes #1139
2014-11-02 00:27:52 -07:00
Kevin Ballard
a4059d3e60 Support wide characters in printf %c 2014-09-21 23:22:43 -07:00
Siteshwar Vashisht
3ac9621f87 Enabled test cases for unicode characters in printf builtin 2013-03-29 12:26:15 +05:30
ridiculousfish
d146f578a4 Fix printf output to store \r instead of \n
Is git breaking line endings?
2013-03-24 15:58:24 -07:00
ridiculousfish
9394583f96 Implement actual error handling for builtin_printf. Fix the tests. 2013-03-24 15:58:24 -07:00
Siteshwar Vashisht
be7d02ebdd Added test cases for printf builtin 2013-03-03 00:45:34 +05:30