Commit Graph

38 Commits

Author SHA1 Message Date
christos
a54fe38a0d fix a volatile variable; from Anon Ymous 2006-12-18 00:37:33 +00:00
snj
a640fe8c43 It's "its." 2006-04-24 19:00:29 +00:00
enami
87aaf3d70d Fix a bug introduced by previous commit. It breaks export command
with multiple arguments if one of them are already set.  Fix PR#27155
and probably PR#27143.
2004-10-06 10:23:43 +00:00
dsl
5f9b910124 Save the length of each variable in the name table so that we can
compare the lengths and then use memcmp() in the search code.
Speeds up one of my scripts by a facter of 2.
Increase the size of the variable hash table.
Cuts down time for script to execute from 60 seconds to 10.
Move variable search into a new function to hide the implementation
from most of the code, new version is slightly smaller than old.
2004-10-02 12:16:53 +00:00
jmmv
aba1ca99ae Include strings.h, needed for index's prototype. 2003-08-26 18:14:24 +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
e314f958bd Support command -p, -v and -V as posix
Stop temporary PATH assigments messing up hash table
Fix sh -c -e "echo $0 $*" -a x (as posix)
(agreed by christos)
2003-01-22 20:36:03 +00:00
agc
ea1d615943 Make this compile on some of the more esoteric architectures (e.g. those
which are not i386)
2002-11-25 12:13:03 +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
bjh21
6f786375c4 Implement sh -a (allexport). Code (all two lines of it) from FreeBSD
(FreeBSD var.c 1.13, sh.1 1.27).
2002-05-15 19:43:29 +00:00
christos
3380980447 remove redundant declarations and nexted externs. 2001-02-04 19:52:06 +00:00
cgd
84d782a52f __CONCAT does token pasting, not string concatnation. if something like:
__CONCAT("PATH=",_PATH_STDPATH);
actually works to concantate strings, it's because the preprocessor expands
it into "PATH=""whatever _PATH_STDPATH is" as separate strings, and then
ANSI string concatenation is performed on that.  It's more straightforward
to just use ANSI string concatenation directly, and newer GCCs complain
(rightly) about mis-use of token pasting.
2000-12-20 00:15:10 +00:00
elric
e6bccfe4be Back out previous vfork changes. 2000-05-22 10:18:46 +00:00
elric
f5dccf4728 When vforking ensure that the environment passed to exec is built before
vforking as a set of local variables which can be popped by the parent.

Addresses bin/10124.
2000-05-17 07:37:12 +00:00
christos
3d42469030 compile with WARNS = 2 1999-07-09 03:05:49 +00:00
kleink
f71d010d24 Add support for the export and readonly -p option. 1999-01-28 18:11:50 +00:00
fair
667e4d4cd1 fix default PATH to be <paths.h> _PATH_DEFPATH 1998-04-07 21:15:33 +00:00
fair
618cca243b Change a few things to reference /usr/include/paths.h instead of local
references. Fixing the default PATH is a bit more effort.
1998-04-07 10:16:04 +00:00
christos
cd799663e4 Fix compiler warnings. 1997-07-04 21:01:48 +00:00
christos
7efa5addb4 Track $TERM and call the appropriate editline(3) routine to update the
terminal type.
1997-04-11 22:45:38 +00:00
christos
7accaec421 NO_HISTORY->SMALL 1997-03-14 01:42:18 +00:00
tls
48250187e6 kill 'register' 1997-01-11 02:04:27 +00:00
christos
1a523dd56b PR/2808: - Don't use p++ in macros.
- Hash using unsigned numbers.
	 (from FreeBSD)
1996-10-16 15:24:31 +00:00
christos
beb57fb35d - Add function callback capability when variables are set.
- Add setvarsafe that returns an error instead of longjmp() to the
  error code.
1996-06-25 16:49:05 +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
mycroft
4d643bf207 Remove `.' from default PATH. 1995-01-20 18:21:16 +00:00
cgd
4ce0d34a31 clean up further. more patches from Jim Jegers 1994-12-05 19:07:32 +00:00
mycroft
06f53b6838 Eliminate uses of some obsolete functions. 1994-09-23 11:28:39 +00:00
mycroft
cafd1f7e9f Add RCS ids. 1994-06-11 16:11:35 +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