diff options
| author | Paul Buetow <paul@buetow.org> | 2008-11-04 21:20:56 +0000 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2008-11-04 21:20:56 +0000 |
| commit | ff0828f06a1f317681c45402feda48bde592a076 (patch) | |
| tree | 7c94275d5ab8b140cd41659d567c09bdc7ca9f16 /src/core/token.c | |
| parent | 48cf82bfc6cd65cc95f7658582fc532602a85ac0 (diff) | |
array_new_size
array_new_copy
implemented
Diffstat (limited to 'src/core/token.c')
| -rw-r--r-- | src/core/token.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/core/token.c b/src/core/token.c index 9d56736..ee2a0b8 100644 --- a/src/core/token.c +++ b/src/core/token.c @@ -317,6 +317,9 @@ void token_copy_vals(Token *p_token_to, Token *p_token_from) { p_token_to->i_line_nr = p_token_from->i_line_nr; p_token_to->i_pos_nr = p_token_from->i_pos_nr; p_token_to->c_filename = p_token_from->c_filename; + + if (NULL != p_token_from->p_array) + p_token_to->p_array = array_new_copy(p_token_from); } void @@ -346,8 +349,10 @@ token_delete(Token *p_token) { if (p_token->c_val) free(p_token->c_val); - if (p_token->p_array) + if (NULL != p_token->p_array) { + array_iterate(p_token->p_array, token_delete_cb); array_delete(p_token->p_array); + } free(p_token); } |
