Commit Graph

716 Commits

Author SHA1 Message Date
christos 2135348107 PR/47608: Robert Elz: ``var=value func-call'' does not export var in the
function (+FIX)
2013-03-02 22:02:32 +00:00
dsl 0e82f4eb77 include limits.h for CHAR_MIN 2013-01-02 22:28:42 +00:00
dsl 658a58d038 Add support for '%n' being a shorthand for 'fg %n'. 2012-12-31 14:10:15 +00:00
dsl 7d60739ae7 Fix the expansion of "$(foo-$bar}" so that IFS isn't applied when
expanding $bar.
Noted by Greg Troxel on tech-userlevel running some 'git' tests.
Should fix PR bin/47361
2012-12-22 20:15:22 +00:00
christos 6814c65d63 PR/47317: Henning Petersen: Replace index() with strchr() 2012-12-13 19:33:23 +00:00
apb ee9a2498cf Adjust everything under src (but outside src/tools) to use
the TOOLDIR version of libnbcompat, associated include files,
and associated defs.mk file, instead of the version from the
.OBJDIR of src/tools/compat.  This should fix PR 47188.
2012-12-02 12:55:27 +00:00
wiz f8c0e3497a - Correct macro usage;
- improve wording, including creating more consistency therein.

From Bug Hunting.
2012-10-03 19:37:36 +00:00
wiz c650101e34 - improve punctuation;
- improve (create more consistency in) spelling;
- remove unnecessary (and in part ignored) macros, as well as an
  unnecessary argument to `.Bl' (fixes mandoc(1) warnings);
- improve wording;
- bump date.

Patch from Bug Hunting.
2012-08-26 14:30:38 +00:00
wiz 123b56dc76 Initialize two variables for clang. 2012-06-17 20:48:27 +00:00
joerg 0adfd5e0b3 Make sure temp_path is always initialised, even if mklocal fails.
Make sure to restore localvars, even if possibly leaking memory.
Discussed with christos@
2012-06-14 18:56:54 +00:00
njoly 089201c2fd Allow thread limit queries by adding the new -r flag to ulimit. Add
the corresponding documentation in the man page.
2012-06-11 18:28:10 +00:00
christos 426530cc5c support RLIMIT_NTHR. 2012-06-09 02:49:48 +00:00
christos a080d61232 include <limits.h> for CHAR_MIN/CHAR_MAX 2012-03-28 20:11:25 +00:00
christos 1cd38287c6 PR/43597: Don't break from parsing word tokens in we are in double quotes.
Fixes: sh -c 'echo "${foo:="first-word"} second-word"'
2012-03-25 18:49:13 +00:00
matt da4f7877a7 Use C89 function definitions 2012-03-20 18:42:28 +00:00
joerg 66dd2755f5 Add __printflike attribution to use vprintf and friends with an argument
as format string.
2012-03-15 02:02:20 +00:00
joerg a401c50446 Don't use a for-loop with empty body. 2012-02-23 18:23:33 +00:00
christos 1847bab548 PR/45613: Aleksey Cheusov: /bin/sh: 'set -e' + 'if eval false' problem
Fixed from: http://www.freebsd.org/cgi/query-pr.cgi?pr=134881&cat=
2011-11-14 18:24:45 +00:00
christos 13d04b5999 print the flag too next to the units like bash does. 2011-10-11 15:27:11 +00:00
christos 790e94dff8 Merge duplicate information. 2011-10-05 13:15:30 +00:00
apb b0bdcb0f27 .Dq Dv \&: 2011-10-04 18:11:27 +00:00
christos 113ec67ab4 Mention what happens when we don't include :. It would be nice to use
.Dv :
but it produces ``'':
2011-10-04 18:07:39 +00:00
dholland d88c027e8a A feature that wasn't implemented for 4.4alpha and still isn't implemented
is just plain not implemented.
2011-09-11 06:02:20 +00:00
plunky 9f61b80465 NULL does not need a cast 2011-08-31 16:24:54 +00:00
joerg 490b73bf85 Mark yyerror as static and __dead. 2011-08-29 14:50:27 +00:00
christos 0404783632 document another non-literal format string 2011-08-23 10:47:06 +00:00
christos 69a4e2ee5b PR/45269: Andreas Gustafsson: Instead of falling off the edge when eating trailing newlines
if the block has moved, arrange so that trailing newlines are never placed in the string
in the first place, by accumulating them and adding them only after we've encountered a
non-newline character. This allows also for more efficient appending since we know how much
we need beforehand. From FreeBSD.
2011-08-23 10:04:39 +00:00
christos d452d7e758 - add pid to the trace file so that we don't keep overwriting ourselves
- use va_copy to print the trace arguments so that we don't deplete it for the real printf
2011-08-23 10:01:32 +00:00
christos 819193d44d add more gcc printf format attributes 2011-08-23 09:59:20 +00:00
christos fe8677c354 Document non-literal formats 2011-08-14 10:53:16 +00:00
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