| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
| |
Fix shifts of possibly negative numbers found with ubsan and avoid signed
integer overflow when hashing an extremely long command name.
MFC after: 1 week
|
| |
|
|
|
|
|
|
|
|
|
| |
Add the space to avoid alias recursion when the alias is expanded, not when
it is added.
As a result, displaying an alias via command -v, command -V or type no
longer erroneously appends a space. Adjust the tests so they now require
this bug to be absent.
|
|
|
|
|
| |
Aliases starting with "-" (which are non-POSIX) will need to be preceded by
an alias not starting with "-" or the newly added "--".
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* The last character is not displayed.
* If the alias ends with itself (as a word), an infinite memory-eating loop
occurs.
If an alias is defined initially, a space is appended to avoid recursion but
this did not happen when an alias was later modified.
PR: bin/173418
Submitted by: Daniel F.
MFC after: 1 week
|
|
|
|
|
|
| |
Have mkbuiltins write the prototypes for the *cmd functions to builtins.h
instead of builtins.c and include builtins.h in more .c files instead of
duplicating prototypes for *cmd functions in other headers.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
These are called "shell procedures" in the source.
If execve() failed with [ENOEXEC], the shell would reinitialize itself
and execute the program as a script. This requires a fair amount of code
which is not frequently used (most scripts have a #! magic number).
Therefore just execute a new instance of sh (_PATH_BSHELL) to run the
script.
|
|
|
|
|
|
| |
This is like error() but without raising an exception.
It is particularly useful as a replacement for the warnx macro in
bltin/bltin.h.
|
|
|
|
| |
and its usage.
|
|
|
|
|
|
| |
breakpoints with in a debugger. And use naked "static" for variables.
Noticed by: bde
|
|
|
|
|
| |
Most of this is adding const keywords, but setvar() in var.c had to be
changed somewhat more.
|
|
|
|
| |
malloc(3) by using a "size_t" instead of an "int" argument
|
|
|
|
| |
- Sort the aliases before printing them.
|
|
|
|
| |
and suppress printing the trailing space which is added for internal purposes.
|
|
|
|
| |
hashalias()
|
| |
|
|
|
|
| |
one.
|
| |
|
|
|
|
| |
OK'ed by: imp, core
|
|
|
|
|
|
|
|
|
|
|
| |
- Removed dead declarations
- Made objects that should have been declared as static, static.
The changes use STATIC instead of static, following the existing
convention in the rest of the code.
Approved by: schweikh (mentor)
MFC after: 2 weeks
|
| |
|
|
|
|
| |
suitable for re-input to the shell (SUSv3)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
o Old-style K&R declarations have been converted to new C89 style
o register has been removed
o prototype for main() has been removed (gcc3 makes it an error)
o int main(int argc, char *argv[]) is the preferred main definition.
o Attempt to not break style(9) conformance for declarations more than
they already are.
o Change
int
foo() {
...
to
int
foo(void)
{
...
|
|
|
|
|
| |
PR: bin/19475
Approved by: Martin Cracauer <cracauer@cons.org> (with conditions)
|
| |
|
|
|
|
| |
Submitted by: Philippe Charnier <charnier@xp11.frmug.org>
|
| |
|
| |
|
|
|
|
| |
Obtained from: NetBSD
|
| |
|
|
|
|
|
|
|
|
| |
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.
Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.
|
|
|
|
| |
Obtained from: NetBSD, me
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
merge of parallel duplicate work by Steve Price and myself. :-]
There are some changes to the build that are my fault... mkinit.c was
trying (poorly) to duplicate some of the work that make(1) is designed to
do. The Makefile hackery is my fault too, the depend list was incomplete
because of some explicit OBJS+= entries, so mkdep wasn't picking up their
source file #includes.
This closes a pile of /bin/sh PR's, but not all of them..
Submitted by: Steve Price <steve@bonsai.hiwaay.net>, peter
|
|
|
|
| |
Reviewed by: phk
|
| |
|
|
|