summaryrefslogtreecommitdiff
path: root/make_cmd.c
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2011-12-03 13:42:25 -0500
committerChet Ramey <chet.ramey@case.edu>2011-12-03 13:42:25 -0500
commit227f982e3db958cbe3c649e8ee7b2bc099250b81 (patch)
tree7459231fb3ab89da5a428765fa447539dbec344f /make_cmd.c
parent6e70dbff655716a31da3871cb8176b21aaef806c (diff)
downloadbash-227f982e3db958cbe3c649e8ee7b2bc099250b81.tar.gz
commit bash-20050120 snapshot
Diffstat (limited to 'make_cmd.c')
-rw-r--r--make_cmd.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/make_cmd.c b/make_cmd.c
index 4ccbf669..0f2f986a 100644
--- a/make_cmd.c
+++ b/make_cmd.c
@@ -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);