aboutsummaryrefslogtreecommitdiffstats
path: root/main/asterisk.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-12-13 08:36:35 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-12-13 08:36:35 +0000
commita41b34a63c52608e7e5c8e6aced613815461f4c2 (patch)
tree0559c99680217b78c0bda37a131b5f09794f43c6 /main/asterisk.c
parentb298a3aa9b396c4055bf75104b4fb89212c44d4a (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.c10
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)