svn commit: r254849 - in head: bin/sh tools/regression/bin/sh/builtins
Jilles Tjoelker
jilles at FreeBSD.org
Sun Aug 25 11:42:53 UTC 2013
Author: jilles
Date: Sun Aug 25 11:42:53 2013
New Revision: 254849
URL: http://svnweb.freebsd.org/changeset/base/254849
Log:
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 "--".
Added:
head/tools/regression/bin/sh/builtins/alias4.0 (contents, props changed)
Modified:
head/bin/sh/alias.c
Modified: head/bin/sh/alias.c
==============================================================================
--- head/bin/sh/alias.c Sun Aug 25 11:34:37 2013 (r254848)
+++ head/bin/sh/alias.c Sun Aug 25 11:42:53 2013 (r254849)
@@ -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);
Added: head/tools/regression/bin/sh/builtins/alias4.0
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/tools/regression/bin/sh/builtins/alias4.0 Sun Aug 25 11:42:53 2013 (r254849)
@@ -0,0 +1,4 @@
+# $FreeBSD$
+
+unalias -a
+alias --
More information about the svn-src-head
mailing list