| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
MFC after: 1 week
|
|
|
|
|
| |
All other global variables are already marked static, so for consistency
sake, add them to these three arrays as well.
|
|
|
|
|
| |
The `struct modes' are only used by the getter-functions in the same
file, so we can safely mark them static and const.
|
| |
|
|
|
|
|
|
|
| |
Free expanded case text before executing commands.
Remove impossible evalskip checks (expanding an argument cannot set
evalskip anymore since $(break) and the like are properly executed in a
subshell environment).
|
| |
|
|
|
|
| |
Spotted by: arundel
|
|
|
|
| |
MFC after: 2 weeks
|
|
|
|
| |
Note that only assigning the decimal value 1 resets getopts, as before.
|
|
|
|
| |
With i386 base gcc and i386 base clang, arith_yacc.o remains unchanged.
|
| |
|
|
|
|
|
|
| |
For these simple utilities, it doesn't harm to make all global variables
static. In fact, this allows the compiler to perform better forms of
optimisation and analysis.
|
|
|
|
|
|
| |
instead of "?".
Submitted by: arundel
|
|
|
|
|
|
|
| |
display() to calculate column widths, but was not initialized in
main(). This resulted in a division by zero.
Noticed by: Michael Butler <imb@protected-networks.net>
|
|
|
|
|
|
|
| |
units (as returned by stat(2)) instead of BLOCKSIZE units.
Submitted by: Paul Schenkeveld
MFC after: 3 weeks
|
|
|
|
| |
MFC after: 3 weeks
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- In the argc == 0 case, just populate the mount list as before, but
do not calculate widths, update totals or print anything.
- In the argv > 0 case, collect information about the requested file
systems and store it in the mount list, but do not calculate
widths, update totals or print anything.
- In either case, once all the information has been collected,
iterate once through the mount list to calculate widths and totals,
then once more to print everything.
This also fixes two bugs: firstly, column widths were not calculated
correctly if more than one file system was specified on the command
line; and secondly, file systems with MNT_IGNORE were included in the
totals even if -a was not specified.
Noticed by: Paul Schenkeveld
MFC after: 3 weeks
|
| |
|
|
|
|
|
|
| |
Submitted by: Valentin Nechayev (netch % netch!kiev!ua), arundel
MFC after: 1 week
With-MFC: 225908
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- there's no reason the semantics of the -x flag are being explained in
the -a flag description
- be more precise regarding the relation between the -a flag and the
security.bsd.see_other_uids sysctl
- describe the format of the -t flag's argument
- 'con' no longer is a possible entry in the 'TT' column
- explain that the 'TT' column refers to pseudo-terminals via mere numbers
- add a hint in the 'tt' keyword description that a keyword 'tty' exists,
which will give the full terminal pathname
Submitted by: arundel (via docs@) (original)
MFC after: 1 week
With-MFC: 225908
|
|
|
|
|
| |
Submitted by: arundel (via docs@)
MFC after: 1 week
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As of FreeBSD 6, devices can only be opened through devfs. These device
nodes don't have major and minor numbers anymore. The st_rdev field in
struct stat is simply based a copy of st_ino.
Simply display device numbers as hexadecimal, using "%#jx". This is
allowed by POSIX, since it explicitly states things like the following
(example taken from ls(1)):
"If the file is a character special or block special file, the
size of the file may be replaced with implementation-defined
information associated with the device in question."
This makes the output of these commands more compact. For example, ls(1)
now uses approximately four columns less. While there, simplify the
column length calculation from ls(1) by calling snprintf() with a NULL
buffer.
Don't be afraid; if needed one can still obtain individual major/minor
numbers using stat(1).
|
|
|
|
|
|
|
| |
PR: 159011
Submitted by: Henning Petersen <henning.petersen@t-online.de>
Approved by: re (kib)
MFC after: 1 week
|
|
|
|
|
|
|
|
|
| |
Provide backward compatibility defines under BURN_BRIDGES.
Suggested by: jhb
Reviewed by: emaste
Sponsored by: Sandvine Incorporated
Approved by: re (kib)
|
|
|
|
|
|
|
|
|
|
|
| |
Because sh executes commands in subshell environments without forking in
more and more cases (particularly from 8.0 on), it makes sense to describe
subshell environments more precisely using ideas from POSIX, together with
some FreeBSD-specific items.
In particular, the hash and times builtins may not behave as if their state
is copied for a subshell environment while leaving the parent shell
environment unchanged.
|
|
|
|
| |
No actual code changes.
|
|
|
|
|
|
| |
to re-establishment of 64bit arithmetic, but is committed separately, to
not obscure that conversion. This commit does not change the observed
behaviour of expr in any way. Style will be fixed in a follow-up commit.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
again. This brings back the behaviour of expr in FreeBSD-4, which had been
reverted due to an assumed incompatbility with POSIX.1 for FreeBSD-5.
This issue has been discussed in the freebsd-standards list, and the
consensus was, that POSIX.1 is in fact not violated by this extension,
since it affects only cases of POSIX undefined behaviour (overflow of
signed long).
Other operating systems did upgrade their versions of expr to support
64bit range, after it had been initially brought to FreeBSD. They have
used it for a decade without problems, meanwhile.
The -e option is retained, but it will only select less strict checking
of numeric parameters (leading white-space, leading "+" are allowed and
skipped, an empty string is considered to represent 0 in numeric context.)
The call of check_utility_compat() as a means of establishing backwards
compatibility with FreeBSD-4 is considered obsolete, but preserved in
this commit. It is expected to be removed in a later revision of this
file.
Reviewed by: bde, das, jilles
MFC after: 2 month (those parts that do not violate POLA)
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* Shell patterns are also for ${var#pat} and the like.
* An '!' by itself will not trigger pathname generation so do not call it a
meta-character, even though it has a special meaning directly after an
'['.
* Character ranges are locale-dependent.
* A '^' will complement a character class like '!' but is non-standard.
MFC after: 1 week
|
|
|
|
|
| |
Suggested by: netchild
Reviewed by: gjb
|
| |
|
| |
|
|
|
|
| |
It expands the arguments in the parent shell process, which is incorrect.
|
|
|
|
|
|
|
|
|
|
| |
POSIX requires a -h option to sh and set, to locate and remember utilities
invoked by functions as they are defined. Given that this
locate-and-remember process is optional elsewhere, it seems safe enough to
make this option do nothing.
POSIX does not specify a long name for this option. Follow ksh in calling it
"trackall".
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replacing ;; with the new control operator ;& will cause the next list to be
executed as well without checking its pattern, continuing until a list ends
with ;; or until the end of the case statement. This is like omitting
"break" in a C "switch" statement.
The sequence ;& was formerly invalid.
This feature is proposed for the next POSIX issue in Austin Group issue
#449.
|
|
|
|
| |
This ensures the output of these commands is valid shell input.
|
|
|
|
|
|
|
|
|
|
| |
The eval special builtin now runs the code with EV_EXIT if it was run
with EV_EXIT itself.
In particular, this eliminates one fork when a command substitution contains
an eval command that ends with an external program or a subshell.
This is similar to what r220978 did for functions.
|
|
|
|
|
| |
Example:
case x in [[:alpha:]]) echo yes ;; esac
|
|
|
|
|
|
|
| |
and effective group name. Also, add "egid", "egroup" and "euid" aliases.
PR: bin/146331
Submitted by: Jeremie Le Hen <jeremie at le-hen dot org>
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
In optimized command substitution, save and restore any variables changed by
expansions (${var=value} and $((var=assigned))), instead of trying to
determine if an expansion may cause such changes.
If $! is referenced in optimized command substitution, do not cause jobs to
be remembered longer.
This fixes $(jobs $!) again, simplifies the man page and shortens the code.
|
|
|
|
|
|
|
|
| |
When I added UTF-8 support in r221646, the LC_COLLATE-based ordering broke
because of sign extension of char.
Because of libc restrictions, this does not work for UTF-8. For UTF-8
locales, ranges always use character code order.
|
|
|
|
|
|
|
|
|
|
| |
In most cases, login shells are started from the home directory, but not in
all, such as xterm -ls.
This commit depends on r222957 for read_profile() performing parameter
expansion.
PR: bin/50569
|
|
|
|
|
|
| |
This is required by POSIX, and allows things like ENV=\$HOME/.shrc.
Note that tilde expansion is explicitly not performed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The function name expandstr() and the general idea of doing this kind of
expansion by treating the text as a here document without end marker is from
dash.
All variants of parameter expansion and arithmetic expansion also work (the
latter is not required by POSIX but it does not take extra code and many
other shells also allow it).
Command substitution is prevented because I think it causes too much code to
be re-entered (for example creating an unbounded recursion of trace lines).
Unfortunately, our LINENO is somewhat crude, otherwise PS4='$LINENO+ ' would
be quite useful.
|
|
|
|
| |
PR: bin/41410
|