sh: Recognize "--" as end of options in alias builtin.
Aliases starting with "-" (which are non-POSIX) will need to be preceded by an alias not starting with "-" or the newly added "--".
This commit is contained in:
parent
e27c6c9fa2
commit
71828da5ff
@ -237,17 +237,19 @@ printaliases(void)
|
||||
}
|
||||
|
||||
int
|
||||
aliascmd(int argc, char **argv)
|
||||
aliascmd(int argc __unused, char **argv __unused)
|
||||
{
|
||||
char *n, *v;
|
||||
int ret = 0;
|
||||
struct alias *ap;
|
||||
|
||||
if (argc == 1) {
|
||||
nextopt("");
|
||||
|
||||
if (*argptr == NULL) {
|
||||
printaliases();
|
||||
return (0);
|
||||
}
|
||||
while ((n = *++argv) != NULL) {
|
||||
while ((n = *argptr++) != NULL) {
|
||||
if ((v = strchr(n+1, '=')) == NULL) /* n+1: funny ksh stuff */
|
||||
if ((ap = lookupalias(n, 0)) == NULL) {
|
||||
warning("%s: not found", n);
|
||||
|
4
tools/regression/bin/sh/builtins/alias4.0
Normal file
4
tools/regression/bin/sh/builtins/alias4.0
Normal file
@ -0,0 +1,4 @@
|
||||
# $FreeBSD$
|
||||
|
||||
unalias -a
|
||||
alias --
|
Loading…
x
Reference in New Issue
Block a user