diff options
author | Jari Aalto <jari.aalto@cante.net> | 2000-03-17 21:46:59 +0000 |
---|---|---|
committer | Jari Aalto <jari.aalto@cante.net> | 2009-09-12 16:46:53 +0000 |
commit | bb70624e964126b7ac4ff085ba163a9c35ffa18f (patch) | |
tree | ba2dd4add13ada94b1899c6d4aca80195b80b74b /copy_cmd.c | |
parent | b72432fdcc59300c6fe7c9d6c8a31ad3447933f5 (diff) | |
download | android_external_bash-bb70624e964126b7ac4ff085ba163a9c35ffa18f.tar.gz android_external_bash-bb70624e964126b7ac4ff085ba163a9c35ffa18f.tar.bz2 android_external_bash-bb70624e964126b7ac4ff085ba163a9c35ffa18f.zip |
Imported from ../bash-2.04.tar.gz.
Diffstat (limited to 'copy_cmd.c')
-rw-r--r-- | copy_cmd.c | 44 |
1 files changed, 42 insertions, 2 deletions
@@ -8,7 +8,7 @@ Bash is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 1, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT @@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License along with Bash; see the file COPYING. If not, write to the Free - Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #include "config.h" @@ -152,6 +152,24 @@ copy_for_command (com) return (new_for); } +#if defined (ARITH_FOR_COMMAND) +static ARITH_FOR_COM * +copy_arith_for_command (com) + ARITH_FOR_COM *com; +{ + ARITH_FOR_COM *new_arith_for; + + new_arith_for = (ARITH_FOR_COM *)xmalloc (sizeof (ARITH_FOR_COM)); + new_arith_for->flags = com->flags; + new_arith_for->line = com->line; + new_arith_for->init = copy_word_list (com->init); + new_arith_for->test = copy_word_list (com->test); + new_arith_for->step = copy_word_list (com->step); + new_arith_for->action = copy_command (com->action); + return (new_arith_for); +} +#endif /* ARITH_FOR_COMMAND */ + static GROUP_COM * copy_group_command (com) GROUP_COM *com; @@ -163,6 +181,18 @@ copy_group_command (com) return (new_group); } +static SUBSHELL_COM * +copy_subshell_command (com) + SUBSHELL_COM *com; +{ + SUBSHELL_COM *new_subshell; + + new_subshell = (SUBSHELL_COM *)xmalloc (sizeof (SUBSHELL_COM)); + new_subshell->command = copy_command (com->command); + new_subshell->flags = com->flags; + return (new_subshell); +} + static CASE_COM * copy_case_command (com) CASE_COM *com; @@ -290,6 +320,12 @@ copy_command (command) new_command->value.For = copy_for_command (command->value.For); break; +#if defined (ARITH_FOR_COMMAND) + case cm_arith_for: + new_command->value.ArithFor = copy_arith_for_command (command->value.ArithFor); + break; +#endif + #if defined (SELECT_COMMAND) case cm_select: new_command->value.Select = @@ -301,6 +337,10 @@ copy_command (command) new_command->value.Group = copy_group_command (command->value.Group); break; + case cm_subshell: + new_command->value.Subshell = copy_subshell_command (command->value.Subshell); + break; + case cm_case: new_command->value.Case = copy_case_command (command->value.Case); break; |