From 95732b497d12c98613bb3c5db16b61f377501a59 Mon Sep 17 00:00:00 2001 From: Jari Aalto Date: Wed, 7 Dec 2005 14:08:12 +0000 Subject: Imported from ../bash-3.1.tar.gz. --- make_cmd.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'make_cmd.c') 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. @@ -76,16 +76,24 @@ cmd_init () ocache_create (wlcache, WORD_LIST, WLCACHESIZE); } +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); } -- cgit v1.2.3