Commit Graph

44 Commits

Author SHA1 Message Date
pooka
db28d5668c Tell copyfd if the caller wants the exact tofd to just fd >= tofd.
Fixes "echo foo > /rump/bar" in a rump hijacked shell.

reviewed by christos
2011-02-17 15:13:49 +00:00
christos
42fececd08 dprintf is claimed by posix. 2010-08-30 06:27:14 +00:00
roy
9fa1d120a0 el_gets now sets el_len to -1 on error so we can distinguish
between a NULL string and an error.
This fixes sh from exiting with libedit now allowing EINTR to return.
We may need to expand this to an errno check in the future.
2009-03-10 21:21:11 +00:00
dholland
0faa1734e3 Use "extern" properly for referencing globals defined in other modules.
Now builds cleanly with -warn-common.
2008-10-16 14:36:40 +00:00
rillig
9da5e43f4d Since interpreting ELF binaries as shell scripts is not very useful, and
since the current error message is less than helpful, improve it.
2007-02-15 12:02:59 +00:00
agc
b5b2954259 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22249, verified by myself.
2003-08-07 09:05:01 +00:00
dsl
a9fc176e82 Don't close any script files if vfork is set.
If a fork() is done later in order to feed a 'here' document into a pipe
then it is possible that one end of the pipe might get closed.
2003-05-15 13:26:45 +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
christos
edcb454443 VFork()ing shell: From elric@netbsd.org:
Plus my changes:
	- walking process group fix in foregrounding a job.
	- reset of process group in parent shell if interrupted before the wait.
	- move INTON lower in the dowait so that the job structure is
	  consistent.
	- error check all setpgid(), tcsetpgrp() calls.
	- eliminate unneeded strpgid() call.
	- check that we don't belong in the process group before we try to
	  set it.
2002-09-27 18:56:50 +00:00
christos
3380980447 remove redundant declarations and nexted externs. 2001-02-04 19:52:06 +00:00
elric
e6bccfe4be Back out previous vfork changes. 2000-05-22 10:18:46 +00:00
elric
756a2ca1bd Now we use vfork(2) instead of fork(2) when we can. 2000-05-13 20:50:14 +00:00
christos
3d42469030 compile with WARNS = 2 1999-07-09 03:05:49 +00:00
christos
efee39278b Simplify interface for general use. 1998-05-20 01:36:14 +00:00
christos
338ea4cec8 fix bug where if moving in history during a multi-line event, the
append to history event would end up in the last event where the history
was moved to instead of the multi-line event; reported by Mycroft
1998-05-20 00:29:26 +00:00
mrg
a26bae1e08 - change "extern" variables into int's
- remove extern'd variables not actually referenced
- don't use char as an array index
1998-03-29 04:41:43 +00:00
christos
946049095f PR/4257: Jaromir Dolecek: Update for libedit interface change. 1997-10-14 15:06:42 +00:00
christos
cd799663e4 Fix compiler warnings. 1997-07-04 21:01:48 +00:00
christos
f726a3c453 Rename pread to preadfd 1997-04-11 23:00:40 +00:00
christos
7accaec421 NO_HISTORY->SMALL 1997-03-14 01:42:18 +00:00
christos
6042831b7e Fix problems with -DNO_HISTORY 1997-03-13 21:57:32 +00:00
mycroft
3a59e5e8e3 Set input files to close-on-exec mode. 1997-03-13 20:07:49 +00:00
tls
48250187e6 kill 'register' 1997-01-11 02:04:27 +00:00
christos
846dce0ee3 Fix problems that gcc -Wall found (from Todd Miller, OpenBSD) 1996-11-02 18:26:03 +00:00
christos
bc73cf950a PR/2808: Remove trailing whitespace (from FreeBSD) 1996-10-16 15:45:03 +00:00
christos
893ade3fac - fix PR1620, -DNO_HISTORY did not work.
- restore parsing state after parsing old style command substitution.
  The ';' in '`echo z;`' broke the following:
	for i in 1; do
		cat > /dev/tty << __EOF__
		`echo z;`
		__EOF__
	done

cVS: Enter Log.  Lines beginning with `CVS: ' are removed automatically
1995-10-19 04:14:37 +00:00
christos
92380da725 fixed previous booboo that broke command line editing input. 1995-10-06 21:38:18 +00:00
christos
c1b02d9bff - Fix -v flag, so that it works properly when the shell reads from scripts.
- Bad style to fix my own PR, but I'd like to commit the parallel make
  changes soon, and this is a necessary prerequisite.
1995-09-26 13:25:19 +00:00
christos
a45947b2a4 Changed so that 'PATH=newpath command' works, instead of looking at the
old path. Synced input.c with vangogh.
1995-06-09 01:53:44 +00:00
cgd
dcb82cbdbc needs string.h 1995-06-07 16:28:03 +00:00
christos
07bae7eddd Merge in my changes from vangogh, and fix the x=false; echo $? == 0
bug.
1995-05-11 21:28:33 +00:00
cgd
49f0ad8601 convert to new RCS id conventions. 1995-03-21 09:01:59 +00:00
cgd
42f0dae5e3 pull prototypes into scope for string functions. 1994-12-23 13:24:10 +00:00
cgd
5dad143982 from James Jegers <jimj@miller.cs.uwm.edu>: quiet -Wall, and squelch
some of the worst style errors.
1994-12-04 07:11:37 +00:00
mycroft
cafd1f7e9f Add RCS ids. 1994-06-11 16:11:35 +00:00
jtc
7210460c54 Fix from Christos for when NO_HISTORY is defined 1994-06-08 19:26:51 +00:00
cgd
242337bcae a few more things to omit when NO_HISTORY defined. from noel@cs.oberlin.edu 1994-05-21 01:42:30 +00:00
cgd
e3c63ad9f3 add back in support for building w/o obj dir. also, add NO_HISTORY
define, which (if you invoke mkbuiltins properly) gets you a sh w/o
history of command line editing (for floppy sh).
1994-05-14 22:20:04 +00:00
jtc
a81e412494 Include appropriate header files to bring function prototypes into scope. 1994-05-12 17:03:32 +00:00
jtc
37ed7877b2 sync with 4.4lite 1994-05-11 17:09:42 +00:00
mycroft
8542364e07 Add RCS identifiers. 1993-08-01 18:49:50 +00:00
cgd
06be60083d changed "Id" to "Header" for rcsids 1993-03-23 00:22:59 +00:00
cgd
346aa5dd48 added rcs ids to all files 1993-03-22 08:04:00 +00:00
cgd
61f282557f initial import of 386bsd-0.1 sources 1993-03-21 09:45:37 +00:00