bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 5/6] Clean: Remove unnecessary xmalloc()/strcpy()


From: Michael Witten
Subject: [PATCH 5/6] Clean: Remove unnecessary xmalloc()/strcpy()
Date: Sun, 27 Feb 2011 17:58:43 -0600

Signed-off-by: Michael Witten <address@hidden>
---
 parse.y |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/parse.y b/parse.y
index a12c4d0..b61c4d0 100644
--- a/parse.y
+++ b/parse.y
@@ -4538,17 +4538,13 @@ read_token_word (character)
             shell's single-character parameter expansions, and set flags.*/
          else if MBTEST(character == '$' && peek_char == '$')
            {
-             ttok = (char *)xmalloc (3);
-             ttok[0] = ttok[1] = '$';
-             ttok[2] = '\0';
              RESIZE_MALLOCED_BUFFER (token, token_index, 2,
                                      token_buffer_size,
                                      TOKEN_DEFAULT_GROW_SIZE);
-             strcpy (token + token_index, ttok);
-             token_index += 2;
+             token[token_index++] = '$';
+             token[token_index++] = '$';
              dollar_present = 1;
              all_digit_token = 0;
-             FREE (ttok);
              goto next_character;
            }
          else
-- 
1.7.4.22.g14b16.dirty




reply via email to

[Prev in Thread] Current Thread [Next in Thread]