christos
a49ff4deac
Avoid segv on "printf '%*********s' 666", from Maksymilian Arciemowicz
2009-10-13 19:28:31 +00:00
lukem
98e5374ccb
Remove the \n and tabs from the __COPYRIGHT() strings.
...
Tweak to use a consistent format.
2008-07-21 14:19:20 +00:00
christos
56fd57d26f
detect more errors from printf/malloc.
2008-03-28 18:05:39 +00:00
dsl
a2a01de947
Remember to consume input bytes when processing '\0nnn' for %b formats
2005-03-22 23:55:46 +00:00
christos
a7e7123b05
- KNF, WARNS=3, pass lint.
...
- Simplify octal parsing code.
2004-10-30 19:28:10 +00:00
agc
89aaa1bb64
Move UCB-licensed code from 4-clause to 3-clause licence.
...
Patches provided by Joel Baker in PR 22365, verified by myself.
2003-08-07 11:13:06 +00:00
dsl
630ca1a3e3
Revert previous. 'None' means that the "Utility Syntax Guidlines" apply.
2003-06-25 12:56:59 +00:00
dsl
0ac8c637fd
Remove getopt() loop, IEEE 1003.1 doesn't say that printf(1) should conform
...
to the "Utility Syntax Guidlines".
Fixes PR 21970.
2003-06-25 09:54:15 +00:00
dsl
a5f7364038
Fix the output of NUL bytes within %b formats.
...
(Approved by Christos)
2003-02-24 14:42:27 +00:00
christos
c02b3bbdf4
Fixes from David Laight:
...
- ansification
- format of output of jobs command (etc)
- job identiers %+, %- etc
- $? and $(...)
- correct quoting of output of set, export -p and readonly -p
- differentiation between nornal and 'posix special' builtins
- correct behaviour (posix) for errors on builtins and special builtins
- builtin printf and kill
- set -o debug (if compiled with DEBUG)
- cd src obj (as ksh - too useful to do without)
- unset -e name, remove non-readonly variable from export list.
(so I could unset -e PS1 before running the test shell...)
2002-11-24 22:35:38 +00:00
tron
5456dc6136
Complete declaration of progprintf() to fix build problem in csh(1).
2002-06-14 11:32:15 +00:00
wiz
085ddec445
Remove #ifdef __STDC__. De-__P() and ANSIfy. Fix a prototype mismatch
...
uncovered by this.
2002-06-14 01:12:15 +00:00
kleink
dd849fecca
Change to use {u,}intmax_t internally (was: (unsigned) long).
2001-05-05 17:29:39 +00:00
christos
76f0fa8f60
brace pollution, and char -> unsigned char
1998-12-19 20:21:44 +00:00
wsanchez
af4e69540c
include unistd
1998-10-14 00:56:00 +00:00
perry
c10fb822b5
add <unistd.h> to fix compiler warning
1998-02-03 03:10:15 +00:00
lukem
2f07741322
s/index/strchr
1997-10-19 22:57:05 +00:00
mrg
09366313d3
"merge" lite-2. our printf is already kinda different...minor changes only.
1997-10-18 15:38:01 +00:00
christos
abc99479ba
Fix compiler warnings.
1997-07-04 21:25:16 +00:00
cgd
8d3057754a
lint and KNF changes. (mostly casting returns to void to quiet lint.)
1997-01-14 19:20:09 +00:00
tls
9d225a1783
RCS ID police
1997-01-09 20:18:21 +00:00
jtc
5d5d116e4a
Simplify conversion of "quoted" numeric arguments.
1994-02-03 01:10:49 +00:00
jtc
14f244e88f
Code to check if conversion (by strtol(), strtoul(), or strtod()) was
...
identical, so I moved it into its own function.
1994-02-03 00:35:18 +00:00
jtc
3c10d8e071
Add and use getulong() to handle %u, %o, %x & %X formatting directives.
...
It was using getlong(), which caused values larger than LONG_MAX to be
truncated to LONG_MAX.
As recommended by 1003.2, print warning messages when argument cannot be
converted to value or is out of range.
1994-02-03 00:16:11 +00:00
jtc
e63929d7f5
Handle format strings error correctly.
1993-12-31 01:46:16 +00:00
jtc
0e4b463504
Error in hextobin() macro messed up hex escape constants.
1993-11-25 04:42:11 +00:00
jtc
4c35e0b3ba
Oops! get rid of the free(), mklong()'s buffer no longer malloc()'d.
1993-11-19 21:08:17 +00:00
jtc
fac5e167cc
Return from main() if a \c escape is encountered in a %b string (was an exit()).
...
Use macro constants for "skip1" and "skip2" instead of assigning them
each loop iteration.
Reformat the multi-case entries in the "big switch" so the lines don't wrap.
1993-11-19 21:05:37 +00:00
jtc
563de0f1c5
Move all the code from do_printf() into do-while loop in main(). I need
...
to be able to return from main() when a "\c" in a %b string is encountered.
1993-11-19 20:50:27 +00:00
jtc
d1a877c5ed
Merged in most of the changes from 4.4 necessary to make printf a sh
...
and csh builtin --- still need to handle the one remaining exit() in
the SysV escape string handling code.
1993-11-19 20:30:57 +00:00
jtc
62f30e8257
Changes required to make printf utility POSIX.2 compliant:
...
* Escape characters in the string needed to be processed as they were
encountered, otherwise a "\000" octal constant would prematurely
terminate the formatting string.
* Implemented the %b, SysV echo(1) compatibility, formatting directive.
1993-11-05 20:12:38 +00:00
mycroft
e9d867ef50
Add RCS identifiers.
1993-08-01 17:54:45 +00:00
mycroft
0b3fc2c11f
Cleanup for GCC 2.
1993-04-19 07:39:27 +00:00
cgd
61f282557f
initial import of 386bsd-0.1 sources
1993-03-21 09:45:37 +00:00