Commit Graph

686 Commits

Author SHA1 Message Date
joerg 90ca8ad494 Move the savehandler assignment before setjmp() to avoid triggering
warnings about use before initialization with clang.
2011-07-12 16:40:41 +00:00
christos 4fc4fe2edf PR/45069: Henning Petersen: Use prototypes from builtins.h . 2011-06-18 21:18:46 +00:00
wiz 8ea06c6ede Sort sections. Remove trailing whitespace. 2011-06-13 20:41:00 +00:00
uebayasi 189ed13db8 Typos. 2011-06-13 00:17:15 +00:00
christos 6f94afca58 document OLDPWD and cd - 2011-06-11 14:37:36 +00:00
uebayasi 82e9aece89 Support $OLDPWD. (christos@ will update the manual.)
Reviewd By:	christos
2011-06-10 02:19:10 +00:00
joerg a216da57a6 Default to -Wno-sign-compare -Wno-pointer-sign for clang.
Push -Wno-array-bounds down to the cases that depend on it.
Selectively disable warnings for 3rd party software or non-trivial
issues to be reviewed later to get clang -Werror to build most of the
tree.
2011-05-26 12:56:24 +00:00
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
jmmv 416c5b0ff8 Call el_source before initializing sh-specific editline properties (i.e.
the editor type and the tab completion binding).

This allows tab completion to work when a user has an ~/.editrc file.

Addresses PR bin/43404.
2011-01-07 22:21:56 +00:00
christos 63cfe07dab PR/44229: Henning Petersen: Remove dup check for whitespace. 2010-12-13 16:54:04 +00:00
christos 7c0ceafd8c revert again, since this breaks libtool amongst other things. 2010-11-17 13:40:48 +00:00
christos abc3b37046 PR/43469: Antii Kantee: test/util/sh/t_expand:strip fails.
Bring back fixes from revision 1.75:

- Fix a couple of bugs to make the following two echo statements print the
  same output as they should:

    line='#define bindir "/usr/bin" /* comment */'
    echo "${line%%/\**}"
    echo ${line%%/\**}

1. ISDBLQUOTE() was not working properly for non VSNORMAL expansions because
   varnest was incremented before the variable was completely parsed. Add
   an insub adjustment to keep track of that.
2. When we have a quoted backslash, we either need to escape twice, because
   one level of escaping will be stripped later (in the variable substitution
   case) or simply enter the backslash.
2010-11-16 18:17:32 +00:00
christos af7c6886fd revert previous. breaks other stuff. 2010-11-14 19:49:16 +00:00
christos 082c42cb76 - Fix a couple of bugs to make the following two echo statements print the
same output as they should:

    line='#define bindir "/usr/bin" /* comment */'
    echo "${line%%/\**}"
    echo ${line%%/\**}

1. ISDBLQUOTE() was not working properly for non VSNORMAL expansions because
   varnest was incremented before the variable was completely parsed. Add
   an insub adjustment to keep track of that.
2. When we have a quoted backslash, we need to escape twice, because one
   level of escaping will be stripped later. (XXX: Do that when insub == 1
   only?)

- Make macros statements
2010-11-14 19:43:38 +00:00
christos 232829f42f don't core-dump if we cannot open the trace file. 2010-11-14 19:36:07 +00:00
stacktic 129baba091 Make sh build in debug mode 2010-10-29 17:06:53 +00:00
stacktic 6a6f2f47f8 Initialized flag field in struct alias (Fixed PR/43281) 2010-10-29 17:04:48 +00:00
christos 42fececd08 dprintf is claimed by posix. 2010-08-30 06:27:14 +00:00
christos f69d85affc increase commented out debugging. 2010-08-30 06:26:59 +00:00
perry 7e5b4620db add bsd.subdir.mk 2010-08-22 02:21:31 +00:00
perry 9573f66f1d RCSIds 2010-08-22 02:19:07 +00:00
perry ee256018ca build the tutoral 2010-08-22 02:09:36 +00:00
perry 32b1d940e0 Extremely extensive updates.
This document should now serve as a reasonable tutorial for the
modern POSIX shell. Comments and additional fixes for mistakes I may
have made are solicited.
2010-08-22 02:03:06 +00:00
perry 62dd025e10 Revive S.R. Bourne's original tutorial on using the Bourne Shell.
This initial commit consists of the files as they existed in 4.4BSD,
with the copyrights altered to reflect the subsequent BSD relicensing.
2010-08-22 01:58:16 +00:00
joerg 0597463e89 Don't quite `+', `-' and `/' in set -x output. 2010-07-19 01:15:17 +00:00
christos eb956cbd4d need errno for the debug build. 2010-06-03 16:14:13 +00:00
christos f82c1d73b2 set -e is supposed to work inside eval; skip EV_TESTED. 2010-06-03 16:06:48 +00:00
dholland 30dd36f330 Note that set -o tabcomplete requires either set -o emacs or set -o vi
to work.
2010-06-03 02:05:02 +00:00
joerg 6004702d47 \\ -> \e 2010-03-01 21:53:58 +00:00
christos d464f08166 fix faulty logic in previous change. 2010-02-21 09:54:57 +00:00
christos 72f71b4cd6 default to the original behavior for $ENV unless POSIXLY_CORRECT is set. 2010-02-20 23:15:17 +00:00
christos 8752bdfe89 PR/42828: Richard Hansen: Don't evaluate ${ENV} if not interactive.
http://www.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_05_03
2010-02-17 15:57:24 +00:00
he 76d4444c78 When using -lcurses, you also need -lterminfo.
This fixes the build for sun2, and also builds with LDSTATIC=-static,
since archive libraries don't record inter-library dependencies.
2010-02-06 23:45:24 +00:00
roy 98eb889579 Userland now builds and uses terminfo instead of termcap.
OK: core@, jdc@
2010-02-03 15:34:37 +00:00
wiz 2afd9d4a18 Bump date for cd -P support. 2010-01-01 21:46:31 +00:00
dholland a5ced5a04b fix another typo 2010-01-01 19:51:19 +00:00
dholland cd0a6973f8 Make the cd builtin accept and ignore -P, which is a kshism that has been
allowed to leak into POSIX and selects the behavior cd already implements.
Closes PR bin/42557 and also relevant to PR pkg/42168.

I suppose this should probably be pulled up to both -4 and -5...
2010-01-01 19:34:59 +00:00
dholland 87e87a1f8c fix typo 2010-01-01 18:09:16 +00:00
christos e3fc7d5ba9 use .ORDER for rules that create multiple files. 2009-12-14 05:13:38 +00:00
uebayasi b79e178285 Rewrite file generation rules using ${GENCMD}. No functional changes intended. 2009-12-11 08:39:42 +00:00
uebayasi 58b17edd41 Define dependencies of arith.[ch] on arith.y. 2009-12-07 16:22:41 +00:00
tsutsui 49ee47d09d Use %zu in printf format for size_t value. 2009-11-27 10:50:04 +00:00
gson dddcd98c78 Removed return statement in parser action that caused a memory leak with
the new yacc, making "sh MAKEDEV -MM init" consume 27 MB of virtual memory
with the result that NetBSD could no longer be installed on a 32 MB system.
2009-11-13 13:49:09 +00:00
christos 5dfc26d510 use flex options instead of #defines 2009-10-29 14:21:40 +00:00
christos 10aa8c24e9 only for when trap if we are going to exit. 2009-10-07 18:12:11 +00:00
christos 40ab82d3c3 fix regression exit1: Don't exec the last command in a subshell if it has
trap[0] (trap EXIT) set. Fork instead to give the shell a chance to execute
the trap when it is done.
2009-10-06 20:05:10 +00:00
apb db8f79df3d Make this slightly more portable; it has to run on arbitary host
platforms at build time.  Previousy, some shells were confused by
some of the "[ ... ]" tests.
2009-10-06 19:56:58 +00:00
joerg f29cf7b612 Make indentation consistent. 2009-05-26 07:30:51 +00:00
drochner 0fa7059102 define YY_NO_INPUT where appropriate, from Kurt J. Lidl per PR misc/41160 2009-04-20 16:05:29 +00:00
wiz 7d6100a52d Bump date for previous. 2009-03-29 08:54:10 +00:00