diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-12-13 08:36:35 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-12-13 08:36:35 +0000 |
commit | a41b34a63c52608e7e5c8e6aced613815461f4c2 (patch) | |
tree | 0559c99680217b78c0bda37a131b5f09794f43c6 /main/asterisk.c | |
parent | b298a3aa9b396c4055bf75104b4fb89212c44d4a (diff) |
Merge ast_str_opaque branch (discontinue usage of ast_str internals)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@163991 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/asterisk.c')
-rw-r--r-- | main/asterisk.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/main/asterisk.c b/main/asterisk.c index c002a4542..8fe421dde 100644 --- a/main/asterisk.c +++ b/main/asterisk.c @@ -2034,7 +2034,7 @@ static char *cli_prompt(EditLine *editline) if (prompt == NULL) { prompt = ast_str_create(100); } else if (!cli_prompt_changes) { - return prompt->str; + return ast_str_buffer(prompt); } else { ast_str_reset(prompt); } @@ -2132,11 +2132,7 @@ static char *cli_prompt(EditLine *editline) } t++; } else { - if (prompt->used + 5 > prompt->len) { - ast_str_make_space(&prompt, prompt->len + 5); - } - prompt->str[prompt->used++] = *t++; - prompt->str[prompt->used] = '\0'; + ast_str_append(&prompt, 0, "%c", *t); } } if (color_used) { @@ -2149,7 +2145,7 @@ static char *cli_prompt(EditLine *editline) ast_str_set(&prompt, 0, "%s", ASTERISK_PROMPT); } - return(prompt->str); + return ast_str_buffer(prompt); } static char **ast_el_strtoarr(char *buf) |