aboutsummaryrefslogtreecommitdiffstats
path: root/builtins/builtin.def
diff options
context:
space:
mode:
authorJari Aalto <jari.aalto@cante.net>2002-07-17 14:10:11 +0000
committerJari Aalto <jari.aalto@cante.net>2009-09-12 16:46:55 +0000
commit7117c2d221b2aed4ede8600f6a36b7c1454b4f55 (patch)
treeb792f26ecca68813c51ed5ba2e381790758ef31b /builtins/builtin.def
parentf73dda092b33638d2d5e9c35375f687a607b5403 (diff)
downloadandroid_external_bash-7117c2d221b2aed4ede8600f6a36b7c1454b4f55.tar.gz
android_external_bash-7117c2d221b2aed4ede8600f6a36b7c1454b4f55.tar.bz2
android_external_bash-7117c2d221b2aed4ede8600f6a36b7c1454b4f55.zip
Imported from ../bash-2.05b.tar.gz.
Diffstat (limited to 'builtins/builtin.def')
-rw-r--r--builtins/builtin.def11
1 files changed, 8 insertions, 3 deletions
diff --git a/builtins/builtin.def b/builtins/builtin.def
index f3de5d6..8571f37 100644
--- a/builtins/builtin.def
+++ b/builtins/builtin.def
@@ -1,7 +1,7 @@
This file is builtin.def, from which is created builtin.c.
It implements the builtin "builtin" in Bash.
-Copyright (C) 1987, 1989, 1991 Free Software Foundation, Inc.
+Copyright (C) 1987-2002 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -39,6 +39,7 @@ $END
#include "../shell.h"
#include "common.h"
+#include "bashgetopt.h"
extern char *this_command_name;
@@ -51,10 +52,14 @@ builtin_builtin (list)
sh_builtin_func_t *function;
register char *command;
- if (!list)
+ if (no_options (list))
+ return (EX_USAGE);
+ list = loptend; /* skip over possible `--' */
+
+ if (list == 0)
return (EXECUTION_SUCCESS);
- command = (list->word->word);
+ command = list->word->word;
#if defined (DISABLED_BUILTINS)
function = builtin_address (command);
#else /* !DISABLED_BUILTINS */