tron
9cae530b67
Revert revisions 1.91 and 1.92. The POSIX spec about the correct behaviour
...
is contradictory at best. And these changes seem to cause more problems
that they are worth.
2008-05-26 14:55:17 +00:00
tron
4d6f948f7a
Fix two more cases of bad handling of "set -e":
...
- false && false
- false || false
2008-05-24 22:24:32 +00:00
tron
c2987416cd
Fix another problem with "set -e": "! true" should terminate the shell.
2008-05-24 19:06:43 +00:00
tron
35fbf8dd7f
Port revision 1.44 of "src/bin/sh/eval.c" from FreeBSD to fix PR bin/38584.
...
Reviewed by Michael van Elst.
2008-05-24 17:12:53 +00:00
martin
3028e483e4
Convert to new 2 clause license
2008-04-29 06:53:00 +00:00
christos
76560beef5
Detect unmatched quotes inside old style command substitution.
...
echo `"`
2008-04-25 17:32:31 +00:00
apb
cd12700971
If SHELL_BUILTIN is defined (as will be the case when building external
...
builtins such as the printf command), then hide a few declarations.
This allows the shell to build again, fixing a problem with
"error" being declared as a function here, and as a variable in
.../usr.bin/printf/printf.c.
2008-03-29 09:58:00 +00:00
apb
d6d9ccc8ad
* define SHELL_BUILTIN, which other headers may use to hide some of their
...
symbols if appropriate. For example, error.h will use it to hide
declarations that should not be seen by external builtins such as printf.
* The shell's outfmt() function returns void, but the standard fprintf()
function returns int. Similarly for several other functions that are
redefined via macros in bltin.h. Add a _RETURN_INT macro to do the
necessary conversion.
* Delete some declarations that appear in error.h.
* Add comments on some #else/#endif lines.
2008-03-29 09:55:40 +00:00
apb
074a931bf5
Remove trailing ';' in definitions of out1c and out2c macros.
2008-03-29 09:49:52 +00:00
dsl
01709217fc
Generate ANSI functions.
...
Just indent the code by a single tab - no need to compare against the
C program generated version any more.
2008-02-27 21:56:14 +00:00
dsl
b63023e666
Change spaces to tabs for consistency with adjacent lines.
2008-02-27 21:55:07 +00:00
matt
4498b1fe25
Fix inconsistent definitions
2008-02-15 17:26:06 +00:00
joerg
f04ccd71b4
Set unique mode for the history, so that repeating a command doesn't
...
spam the history.
2008-02-13 12:57:16 +00:00
msaitoh
899c734b12
Conform to XCU Section 2.8.2 (Exit Status for Commands)
2008-01-21 06:43:03 +00:00
dogcow
90ee124aaf
This should have been all on one line anyway - and hey, it fixes my build
...
issue.
2007-12-18 07:25:00 +00:00
perry
8b0f9554ff
convert __attribute__s to applicable cdefs.h macros
2007-12-15 19:44:37 +00:00
lukem
bcf893f432
use __RCSID()
2007-12-12 22:55:42 +00:00
christos
2554aff24b
PR/36531: Greg A. Woods: another very helpful DEBUG TRACE() call for execve()
...
failures in /bin/sh
2007-06-24 18:36:23 +00:00
christos
546dff6580
PR/36533: Greg A. Woods: minor doc fixes for sh(1)
2007-06-24 17:57:56 +00:00
dsl
8da3353686
Fix sh -c 'true && ! true | false; echo $?'
...
Add some more TRACE((...)) calls to aid such debugging.
Fixes PR bin/36435
Clearly no one tried this test when the changes of rev 1.31 and 1.44 were done!
2007-06-07 20:57:59 +00:00
apb
faafdc7e21
Document that shell arithmetic now uses intmax_t. Document that
...
variables in shell arithmetic don't need "$" signs.
2007-03-25 06:56:43 +00:00
apb
1a20cbd95e
WARNS=4
2007-03-25 06:30:37 +00:00
apb
91ce988bec
Make /bin/sh use intmax_t (instead of int) for arithmetic in $((...)).
2007-03-25 06:29:26 +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
christos
30760cbdc7
PR/35410: Valeriy E. Ushakov: /bin/sh mishandles shell function definitions
...
with function names that are not plain words
1. remove the escape annotations from the function name.
2. check if the function has a valid name before storing it.
2007-01-13 18:58:26 +00:00
christos
a54fe38a0d
fix a volatile variable; from Anon Ymous
2006-12-18 00:37:33 +00:00
wiz
5c056f6785
s/apparant/apparent/, from Zafer.
2006-11-24 22:54:47 +00:00
christos
272937609b
sprinkle volatile.
2006-10-16 00:36:19 +00:00
christos
ab28bede4c
Prefix "Syntax Error" with the program name, if the command name is not
...
available. At least this way we get an idea of what program gives us the
message.
2006-10-04 15:00:38 +00:00
dsl
1719403bf2
Fix typo, update date.
...
Fixes PR/34472
2006-09-04 20:30:36 +00:00
dsl
c58b829dda
Set the 'not a parameter' flag when we skip initial whitespace.
...
Otherwise:
./sh -c 'x=" "; for a in $x; do echo a${a}a; done'
is processed as a single empty parameter (instead of no parameters).
Should fix the breakage I introdiced in rev 1.75 and PR/34256 and PR/34254
2006-08-22 18:11:42 +00:00
dsl
413b7762c2
Rework the code changes from revisions 1.69, 1.70 and 1.74 so that the code
...
behaves correctly.
As far as I can tell, "x$@y" now expands correctly, as does IFS=:; set -$IFS.
Fixes PR/33472 (again) and PR/33956
2006-08-21 21:30:14 +00:00
christos
a8b3562160
PR/33775: YAMAMOTO Takashi: /bin/sh doesn't accept "(" before case patterns
2006-06-20 15:57:44 +00:00
dsl
0e765f005a
When expanding "$@" add a \0 byte after the last argument (as well as all
...
the earlier ones) so that a separator is added before it when it is empty.
This wasn't needed before a recent change that chenged the behaviour of
trailing whitespace IFS characters.
Fixed PR/33472
2006-05-20 13:57:27 +00:00
christos
e80f354dab
Coverity CID 3384: Don't close -1.
2006-05-13 19:47:22 +00:00
mrg
084c052803
quell GCC 4.1 uninitialised variable warnings.
...
XXX: we should audit the tree for which old ones are no longer needed
after getting the older compilers out of the tree..
2006-05-10 21:53:14 +00:00
simonb
15dc85722d
Make the change for bin/31548 to set $PWD on shell startup non-fatal if
...
the current directory doesn't exist.
2006-05-04 11:16:53 +00:00
snj
a640fe8c43
It's "its."
2006-04-24 19:00:29 +00:00
snj
bf5ceaae16
It's "its."
2006-04-24 18:00:53 +00:00
christos
da09d1a838
PR/33281: Martin J. Laubach: Prevent core-dump on "echo abc | { }". bash
...
prints and error and ksh prints nothing. We go the ksh way.
2006-04-18 14:44:05 +00:00
christos
3e359756c9
Coverity CID 620: Remove dead code.
2006-03-18 05:25:56 +00:00
christos
f6828859fa
Coverity CID 890: Possible NULL pointer deref.
2006-03-18 05:23:08 +00:00
christos
169a269417
Coverity CID 1329: Possible NULL deref.
2006-03-18 05:17:36 +00:00
christos
df8cbb182e
Coverity CID 2479: Clarify confusion about uninitialized variable in the
...
presence of setjmp/vfork.
2006-03-17 17:20:47 +00:00
rumble
2174dda221
Handle asprintf failing to allocate.
2006-03-17 14:43:11 +00:00
aymeric
d5d0c11532
Make the -s flag of fc work correctly. Ensure that only one command is specified
...
and ensure that we break out of the loop after executing it.
With the previous code, because the re-executed command was added to the
history, it would think that it still had to execute it, leading to an infinite
loop.
The last thing which differs from ksh is that we get the "fc -s " command into
the history, but this is actually rather a feature in my humble opinion.
To test:
$ echo hello
$ fc -s ec
<infinite loop or correct behaviour>
2006-03-06 00:09:22 +00:00
garbled
6ac601d8c4
Add error printing for ENAMETOOLONG. Partially addresses PR bin/13850 .
...
The actual bug mentioned in that PR no longer exists, but it does cause:
~~~~~: error 63
Which this fix cleans up.
2006-01-02 19:10:33 +00:00
dsl
ea2078818f
TOG require that 'set +o' output the options in a form suitable for
...
restoring them - make it so.
2005-12-13 17:44:18 +00:00
dsl
e60beff86b
Don't change the name of the directory we are going to 'cd' to just because
...
we decide to remove a leading "./" when deciding whether to print the name.
Stops 'cd .//tmp' ending up the same as 'cd /tmp'.
Fixes PR/30735
2005-11-26 21:44:43 +00:00
christos
8d6ffce2ad
PR/31548: Alexander Rigbo: $PWD not set when shell starts up, before pwd
...
or cd get executed.
2005-10-10 21:14:42 +00:00