aboutsummaryrefslogtreecommitdiffstats
path: root/make_cmd.c
diff options
context:
space:
mode:
authorJari Aalto <jari.aalto@cante.net>2005-12-07 14:08:12 +0000
committerJari Aalto <jari.aalto@cante.net>2009-09-12 16:46:57 +0000
commit95732b497d12c98613bb3c5db16b61f377501a59 (patch)
tree5e1cdf79eb0407e09dca4c0ec29e11442c7d1d15 /make_cmd.c
parenteb87367179effbe5f430236db8259006d71438b7 (diff)
downloadandroid_external_bash-95732b497d12c98613bb3c5db16b61f377501a59.tar.gz
android_external_bash-95732b497d12c98613bb3c5db16b61f377501a59.tar.bz2
android_external_bash-95732b497d12c98613bb3c5db16b61f377501a59.zip
Imported from ../bash-3.1.tar.gz.
Diffstat (limited to 'make_cmd.c')
-rw-r--r--make_cmd.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/make_cmd.c b/make_cmd.c
index 479d9c3..df20010 100644
--- a/make_cmd.c
+++ b/make_cmd.c
@@ -1,7 +1,7 @@
/* make_cmd.c -- Functions for making instances of the various
parser constructs. */
-/* Copyright (C) 1989-2003 Free Software Foundation, Inc.
+/* Copyright (C) 1989-2005 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -77,15 +77,23 @@ cmd_init ()
}
WORD_DESC *
+alloc_word_desc ()
+{
+ WORD_DESC *temp;
+
+ ocache_alloc (wdcache, WORD_DESC, temp);
+ temp->flags = 0;
+ temp->word = 0;
+ return temp;
+}
+
+WORD_DESC *
make_bare_word (string)
const char *string;
{
WORD_DESC *temp;
-#if 0
- temp = (WORD_DESC *)xmalloc (sizeof (WORD_DESC));
-#else
- ocache_alloc (wdcache, WORD_DESC, temp);
-#endif
+
+ temp = alloc_word_desc ();
if (*string)
temp->word = savestring (string);
@@ -95,7 +103,6 @@ make_bare_word (string)
temp->word[0] = '\0';
}
- temp->flags = 0;
return (temp);
}
@@ -161,11 +168,8 @@ make_word_list (word, wlink)
{
WORD_LIST *temp;
-#if 0
- temp = (WORD_LIST *)xmalloc (sizeof (WORD_LIST));
-#else
ocache_alloc (wlcache, WORD_LIST, temp);
-#endif
+
temp->word = word;
temp->next = wlink;
return (temp);
@@ -255,7 +259,7 @@ make_arith_for_expr (s)
if (s == 0 || *s == '\0')
return ((WORD_LIST *)NULL);
wd = make_word (s);
- wd->flags |= W_NOGLOB|W_NOSPLIT|W_QUOTED; /* no word splitting or globbing */
+ wd->flags |= W_NOGLOB|W_NOSPLIT|W_QUOTED|W_DQUOTE; /* no word splitting or globbing */
result = make_word_list (wd, (WORD_LIST *)NULL);
return result;
}
@@ -355,6 +359,7 @@ COMMAND *
make_case_command (word, clauses, lineno)
WORD_DESC *word;
PATTERN_LIST *clauses;
+ int lineno;
{
CASE_COM *temp;
@@ -377,6 +382,7 @@ make_pattern_list (patterns, action)
temp->patterns = REVERSE_LIST (patterns, WORD_LIST *);
temp->action = action;
temp->next = NULL;
+ temp->flags = 0;
return (temp);
}