aboutsummaryrefslogtreecommitdiffstats
path: root/builtins/command.def
diff options
context:
space:
mode:
authorJari Aalto <jari.aalto@cante.net>2001-11-13 17:56:06 +0000
committerJari Aalto <jari.aalto@cante.net>2009-09-12 16:46:54 +0000
commitf73dda092b33638d2d5e9c35375f687a607b5403 (patch)
treef21584e70a444d6a1ecba0fb5e2cf79e8cce91db /builtins/command.def
parent28ef6c316f1aff914bb95ac09787a3c83c1815fd (diff)
downloadandroid_external_bash-f73dda092b33638d2d5e9c35375f687a607b5403.tar.gz
android_external_bash-f73dda092b33638d2d5e9c35375f687a607b5403.tar.bz2
android_external_bash-f73dda092b33638d2d5e9c35375f687a607b5403.zip
Imported from ../bash-2.05a.tar.gz.
Diffstat (limited to 'builtins/command.def')
-rw-r--r--builtins/command.def16
1 files changed, 11 insertions, 5 deletions
diff --git a/builtins/command.def b/builtins/command.def
index a3f25f2..28515be 100644
--- a/builtins/command.def
+++ b/builtins/command.def
@@ -49,10 +49,14 @@ $END
#include "bashgetopt.h"
#include "common.h"
+#if defined (_CS_PATH) && defined (HAVE_CONFSTR) && !HAVE_DECL_CONFSTR
+extern size_t confstr __P((int, char *, size_t));
+#endif
+
extern int subshell_environment;
-static void restore_path ();
-static char *get_standard_path ();
+static void restore_path __P((char *));
+static char *get_standard_path __P((void));
/* Run the commands mentioned in LIST without paying attention to shell
functions. */
@@ -131,11 +135,13 @@ command_builtin (list)
FREE (standard_path);
}
+#define COMMAND_BUILTIN_FLAGS (CMD_NO_FUNCTIONS | CMD_INHIBIT_EXPANSION | CMD_COMMAND_BUILTIN)
+
command = make_bare_simple_command ();
command->value.Simple->words = (WORD_LIST *)copy_word_list (list);
command->value.Simple->redirects = (REDIRECT *)NULL;
- command->flags |= (CMD_NO_FUNCTIONS | CMD_INHIBIT_EXPANSION);
- command->value.Simple->flags |= (CMD_NO_FUNCTIONS | CMD_INHIBIT_EXPANSION);
+ command->flags |= COMMAND_BUILTIN_FLAGS;
+ command->value.Simple->flags |= COMMAND_BUILTIN_FLAGS;
#if 0
/* This breaks for things like ( cd /tmp ; command z ababa ; echo next )
or $(command echo a ; command echo b;) or even
@@ -184,7 +190,7 @@ get_standard_path ()
len = (size_t)confstr (_CS_PATH, (char *)NULL, (size_t)0);
if (len > 0)
{
- p = xmalloc ((int)len + 2);
+ p = (char *)xmalloc (len + 2);
*p = '\0';
confstr (_CS_PATH, p, len);
return (p);