Commit Graph

365 Commits

Author SHA1 Message Date
bjh21 45a6b58c3e Use ${MACHINE_CPU} == "arm" to test for ARMishness. 2001-04-18 17:35:36 +00:00
christos ea8e5cf90b PR/12533: Koji Mori: eval gets misparsed when it has a trailing semi-colon. 2001-04-03 15:00:11 +00:00
wiz 242b959069 Don't xref set(1) and case(1), since they are builtins and we don't
have separate man pages for them.
Xref passwd 5 instead of 4, environ 7 instead of 5, and comment out xref
to profile(4), which we don't have.
Improve markup of SYNOPSIS.
Some whitespace fixes while I'm here.
2001-04-03 10:56:03 +00:00
toddpw e08886d505 Correct {list;} example and fix formatting/typo in the operator lists. 2001-04-01 02:15:45 +00:00
mycroft 59771e308b Globbing should match broken symlinks. stat()->lstat() to fix this. 2001-03-30 17:45:00 +00:00
wulf 8d23cb0373 Extended functionality of the trap builtin, which now closely follows
POSIX recommendations.

	- trap now accepts signal names and signal numbers
	  e.g. INT, SIGINT, 2
	- added option -l that outputs a list of valid signals
	- added signal EXIT to list of valid signals
	- a `-' in the action part will reset specified signal to their
	  default behaviour
	- changed standard output format to make it suitable as an input
	  to another shell that achieves the same trapping results
2001-03-18 04:04:23 +00:00
wiz 8d35854b5d Fix command name in error message for 'sh nonexistingfile'. 2001-02-26 13:06:43 +00:00
christos 3380980447 remove redundant declarations and nexted externs. 2001-02-04 19:52:06 +00:00
christos 80d86b9e7c remove redundant declaration of yyparse, and move code to the bottom of
the file.
2001-02-04 19:51:43 +00:00
lukem 10fc746e6d if HAVE_VASPRINTF (set ifdef BSD4_4), use vasprintf() instead of homegrown
code in doformat().  results in slightly smaller /bin/sh.  idea suggested by
Witold J. Wnuk <witek@pd37.warszawa.sdi.tpnet.pl>, approved by christos.
2001-01-07 23:39:07 +00:00
lukem dd7296f47a support %ll (as synonym for %q) in doformat(), since my changes to %q -> %ll
broke this :/
problem reported in private email by Witold J. Wnuk.
<witek@pd37.warszawa.sdi.tpnet.pl>.
2001-01-07 22:19:53 +00:00
lukem f819878ce7 use more standard %ll_ in favour of %q_ 2001-01-04 15:39:50 +00:00
bjh21 c9ee8d3362 arm26 has unsigned chars too. 2000-12-29 16:30:31 +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
christos 1d9dab3e95 error message cleanup:
- don't print the builtin name twice
    - explain why things fail
    - no extra newline
2000-11-22 19:20:31 +00:00
christos 212627911f fix typo. 2000-11-20 17:48:05 +00:00
christos fb16d6d0ec Add an example on how to use getopts, stolen from the getopt manual page :-) 2000-11-20 16:59:56 +00:00
mycroft 3112db7eb8 Call el_source() to use .editrc. 2000-11-06 04:21:14 +00:00
christos 8e2797bc1e PR/11283: Hubert Feyrer: random memory corruption executing commands:
Fix from FreeBSD:

    growstackblock() sometimes relocates a stack_block considered empty
    without properly relocating stack marks referencing that block.
    The first call to popstackmark() with the unrelocated stack mark
    as argument then causes sh to abort.

    Relocating the relevant stack marks seems to solve this problem.

    The patch changes the semantics of popstackmark() somewhat.  It can
    only be called once after a call to setstackmark(), thus cmdloop() in
    main.c needs an extra call to setstackmark().
2000-11-01 19:56:01 +00:00
christos 9cc4e15f46 handle type command on names that contain slashes, and print a : in the not
found case. From FreeBSD.
2000-11-01 19:21:41 +00:00
mycroft 8f48358936 Wrap malloc() calls with an INTOFF/INTON pair. Fixes PR 8414. 2000-10-21 04:37:17 +00:00
phil 34ad57a779 .Bl takes parameter "-offset indent", not "-indent". 2000-09-21 21:04:56 +00:00
kleink 2caf6aacdd For commands and utilities, use EXIT STATUS rather than RETURN VALUES as
appropriate (and documented in mdoc(7)).
2000-09-04 07:30:07 +00:00
hubertf 1cb54f68ac Add 'RETURN VALUE' section header. 2000-08-28 02:11:04 +00:00
cgd 2a1ee59131 un-__P functions declared in parser.h. host programs include parser.h,
and so it shouldn't use __P.  (this should probably be done better, by
not declaring the parser functions in headers used by host programs,
but this works well enough.)
2000-07-27 04:09:27 +00:00
cgd 96df053cba host program portability: set infp to stdin at runtime, since apparently
some systems (e.g. linux) define stdin in such a way that it can't
be used to initialize values at compile time.
2000-07-27 04:06:49 +00:00
cgd 28728fd305 host program portability: don't use <sys/cdefs.h>, __COPYRIGHT(),
__RCSID(), or __P().  (these programs have been de-__P()'d.)
Repeat after me: "Not all cross-compilation host systems are NetBSD."
2000-07-18 19:13:20 +00:00
jhawk 9d53f2aee6 Various mandoc updates to the Builtins
section; mostly .Ic, a few other nits.
2000-07-18 01:55:48 +00:00
jhawk 45a8e6b7e3 Note the meaning of 'trap 0' (execute on exit from shell) 2000-07-17 21:18:47 +00:00
matt e2056eada9 include <stdlib.h>, <string.h>, or whatever as appropriate to shut up
gcc 2.96
2000-07-03 03:26:17 +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
elric e8b0f2b813 INTON and FORCEINTON modify global variables, and so should not be
executed while we are vforked.
2000-05-15 03:42:48 +00:00
elric c55fa30be8 Added includes for waitpid, sys/types.h and sys/wait.h. 2000-05-13 21:11:45 +00:00
elric a0ef2ea948 In order to use __NetBSD_Version__, I needed to include sys/param.h. 2000-05-13 21:11:16 +00:00
elric 0eece24a3a Unused variable pgrp on line 576. 2000-05-13 20:59:41 +00:00
elric 4aeaa113a7 Quick fix.
jobs.h:91: warning: declaration of `vfork' shadows global declaration
2000-05-13 20:56:08 +00:00
elric 756a2ca1bd Now we use vfork(2) instead of fork(2) when we can. 2000-05-13 20:50:14 +00:00
simonb d2f6a4723d Include <errno.h> instead of using "extern int errno;". 2000-04-14 05:54:20 +00:00
simonb 51ee9dc68d Don't declare 'extern opt*' getopt variables. 2000-04-14 05:52:56 +00:00
christos b252543484 PR/9847: Geoff C. Wing: Make test(1) a builtin. 2000-04-09 23:27:03 +00:00
soren 1594850f00 Fix doubled 'the' in comment. 2000-03-13 22:46:59 +00:00
christos 9fcfbaea4d Fix problem where commands that caused exitstatus != 0 inside loops did
not cause the shell to exit when -e was set.
2000-02-09 20:26:53 +00:00
christos d6ac7627ea Fix bin/9184, bin/9194, bin/9265, bin/9266
Exitcode and negation problems (From Martin Husemann)
2000-01-27 23:39:38 +00:00
hubertf a8bbeb8a4b Add under which conditions the "read" builtin returns success/failure.
Suggested in PR 8813 by Eric Mumpower <nocturne@arepa.com>
1999-11-16 22:03:25 +00:00
mrg 1b23e7d142 back out previous; it causes /etc/rc to break on my alpha and other lossage as reported in PR#8614 1999-10-13 00:59:10 +00:00
pk ef45922abf Backtrack `exitstatus' to make the shell really ignore the status
of `tested commands' as in this example:

	set -e
	true; false && echo "not reached"
1999-10-10 21:22:24 +00:00
pk 8c06f48e15 Sprinkle some `const's in DEBUG bracketed code. 1999-10-08 21:10:44 +00:00
bouyer d406538de6 xref sysctl(8) (for proc.<pid>.rlimits) 1999-09-28 14:54:41 +00:00
mjl 4c5c12b3f0 Mention -c option to sh(1), noticed by Matthew Aldous in PR/8499. 1999-09-27 19:34:25 +00:00