summaryrefslogtreecommitdiffstats
path: root/bin/sh/output.c
Commit message (Collapse)AuthorAgeFilesLines
* sh: Remove output.c's reset() handler.jilles2013-07-251-19/+0
| | | | | These cleanup operations are not needed because they are already performed after an optimized command substitution (whether there was an error or not).
* sh: Detect and flag write errors on stdout in builtins.jilles2012-12-121-0/+14
| | | | | | | If there is a write error on stdout, a message will be printed (to stderr) and the exit status will be changed to 2 if it would have been 0 or 1. PR: bin/158206
* sh: Use vsnprintf() rather than crafting our own in fmtstr().jilles2010-12-111-18/+5
| | | | | Add INTOFF/INTON as longjmp out of vsnprintf may cause memory leaks or undefined behaviour.
* sh: Code size optimizations to buffered output.jilles2010-11-201-3/+9
| | | | | | This is mainly less use of the outc macro. No functional change is intended, but code size is about 2K less on i386.
* sh: Add binary buffered output for use by the printf builtin.jilles2010-11-141-10/+13
|
* In the spirit of r90111, depend on c89 and remove the "STATIC" macroobrien2010-10-131-2/+2
| | | | and its usage.
* Consistently use "STATIC" for all functions in order to be able to setobrien2010-10-131-3/+3
| | | | | | breakpoints with in a debugger. And use naked "static" for variables. Noticed by: bde
* sh: Constify various strings.jilles2009-12-241-1/+1
| | | | | Most of this is adding const keywords, but setvar() in var.c had to be changed somewhat more.
* sh: Some changes to stderr flushing:jilles2009-11-211-4/+2
| | | | | | | | | * increase buffer size from 100 to 256 bytes * remove implied flush from out2str(), in particular this avoids unnecessary flushing in the middle of a -x tracing line * rename dprintf() to out2fmt_flush(), make it flush out2 and use this function in various places where flushing is desired after an error message
* Fix some issues with quoted output and shorten it in some cases.jilles2009-06-191-9/+15
| | | | | | | | | | | | | | Output quoted suitable for re-input to the shell occurs in various cases such as 'set', 'trap'. Bugfix: *, ? and [ must be quoted (except sole [) Bugfix: ~ and # must be quoted (really only sometimes, but keep it simple) Bugfix: space, tab and newline must always be quoted Shortening: other IFS characters do not need quoting Bugfix: send to correct output file, not hard-coded stdout Shortening: avoid unnecessary '' with \' Approved by: ed (mentor)
* Print empty quotes ('') when an empty string is passed to outqstr().stefanf2005-12-081-0/+4
| | | | | | | This makes a difference for the trap builtin, where after "trap '' 0" we printed "trap -- quit". This is wrong, because an empty action means to reset the action to the default. A side effect of this commit is that empty variables are now printed as "variable=''" instead of just "variable=".
* Remove clause 3 from the UCB licenses.markm2004-04-061-4/+0
| | | | OK'ed by: imp, core
* Changes following CScout analysis:dds2003-07-051-1/+1
| | | | | | | | | | | - Removed dead declarations - Made objects that should have been declared as static, static. The changes use STATIC instead of static, following the existing convention in the rest of the code. Approved by: schweikh (mentor) MFC after: 2 weeks
* Back out experimental changes to fmtstr() that I didn't mean to includetjr2002-10-011-1/+9
| | | | in the previous commit.
* Replace a home-grown printf() clone with a fwopen() wrapper aroundtjr2002-10-011-190/+23
| | | | | libc's vfprintf() that writes to a `struct output' instead of a file. Inspired by NetBSD's similar changes (they used asprintf() instead).
* Consistently use FBSDIDobrien2002-06-301-2/+2
|
* Don't modify output that is to be quoted if it contains no IFS characterstjr2002-06-061-0/+7
| | | | or shell metacharacters.
* Quote alias values in the output of the alias(1) builtin so they aretjr2002-06-041-1/+32
| | | | suitable for re-input to the shell (SUSv3)
* o __P has been reovedimp2002-02-021-145/+26
| | | | | | | | | | | | | | | | | | o Old-style K&R declarations have been converted to new C89 style o register has been removed o prototype for main() has been removed (gcc3 makes it an error) o int main(int argc, char *argv[]) is the preferred main definition. o Attempt to not break style(9) conformance for declarations more than they already are. o Change int foo() { ... to int foo(void) { ...
* -Wnon-const-format sweep: make format strings const char *'s, addkris2001-04-171-9/+9
| | | | | | __printflike()/__printf0like() to function prototypes, as appropriate. Reviewed by: bde, -audit
* $Id$ -> $FreeBSD$peter1999-08-271-1/+1
|
* Add rcsid. Spelling.charnier1998-05-181-3/+5
|
* Remove an extra semicolon and nuke register keyword usage.steve1997-04-281-7/+7
|
* Revert $FreeBSD$ to $Id$peter1997-02-221-1/+1
|
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* Merge in NetBSD mods and -Wall cleaning.steve1996-12-141-15/+11
| | | | Obtained from: NetBSD, me
* Fix for PR#1287. This makes sh behave sensibly in case statements in thepeter1996-09-031-5/+15
| | | | | | | | | | | | | | face of aliases. Note, bash doesn't do aliases while running scripts, but "real" ksh does.. Also: Reduce redundant .Nm macros in (unused) bltin/echo.1 nuke error2, it's hardly used. More -Wall cleanups dont do certain history operations if NO_HISTORY defined handle quad_t's from resource limits Submitted by: Steve Price <sprice@hiwaay.net> (minor tweaks by me)
* Merge of 4.4-Lite2 sh source, plus some gcc -Wall cleaning. This is apeter1996-09-011-12/+23
| | | | | | | | | | | | | | merge of parallel duplicate work by Steve Price and myself. :-] There are some changes to the build that are my fault... mkinit.c was trying (poorly) to duplicate some of the work that make(1) is designed to do. The Makefile hackery is my fault too, the depend list was incomplete because of some explicit OBJS+= entries, so mkdep wasn't picking up their source file #includes. This closes a pile of /bin/sh PR's, but not all of them.. Submitted by: Steve Price <steve@bonsai.hiwaay.net>, peter
* Added $Id$dg1994-09-241-0/+2
|
* BSD 4.4 Lite bin Sourcesrgrimes1994-05-261-0/+554
OpenPOWER on IntegriCloud