version 1.15, 2011/01/05 22:38:28 |
version 1.16, 2011/05/20 19:29:13 |
|
|
const char *prompts; |
const char *prompts; |
struct cmd_command_prompt_cdata *cdata; |
struct cmd_command_prompt_cdata *cdata; |
struct client *c; |
struct client *c; |
char *prompt, *ptr; |
char *prompt, *prompt_replaced, *ptr; |
size_t n; |
size_t n; |
|
|
if ((c = cmd_find_client(ctx, args_get(args, 't'))) == NULL) |
if ((c = cmd_find_client(ctx, args_get(args, 't'))) == NULL) |
|
|
ptr = strsep(&cdata->next_prompt, ","); |
ptr = strsep(&cdata->next_prompt, ","); |
if (prompts == NULL) |
if (prompts == NULL) |
prompt = xstrdup(ptr); |
prompt = xstrdup(ptr); |
else |
else { |
xasprintf(&prompt, "%s ", ptr); |
prompt_replaced = status_replace(c, NULL, NULL, NULL, ptr, |
|
time(NULL), 0); |
|
xasprintf(&prompt, "%s ", prompt_replaced); |
|
xfree(prompt_replaced); |
|
} |
status_prompt_set(c, prompt, cmd_command_prompt_callback, |
status_prompt_set(c, prompt, cmd_command_prompt_callback, |
cmd_command_prompt_free, cdata, 0); |
cmd_command_prompt_free, cdata, 0); |
xfree(prompt); |
xfree(prompt); |
|
|
struct cmd_list *cmdlist; |
struct cmd_list *cmdlist; |
struct cmd_ctx ctx; |
struct cmd_ctx ctx; |
char *cause, *newtempl, *prompt, *ptr; |
char *cause, *newtempl, *prompt, *ptr; |
|
char *prompt_replaced; |
|
|
if (s == NULL) |
if (s == NULL) |
return (0); |
return (0); |
|
|
cdata->template = newtempl; |
cdata->template = newtempl; |
|
|
if ((ptr = strsep(&cdata->next_prompt, ",")) != NULL) { |
if ((ptr = strsep(&cdata->next_prompt, ",")) != NULL) { |
xasprintf(&prompt, "%s ", ptr); |
prompt_replaced = status_replace(c, NULL, NULL, NULL, ptr, |
|
time(NULL), 0); |
|
xasprintf(&prompt, "%s ", prompt_replaced); |
status_prompt_update(c, prompt); |
status_prompt_update(c, prompt); |
|
|
|
xfree(prompt_replaced); |
xfree(prompt); |
xfree(prompt); |
cdata->idx++; |
cdata->idx++; |
return (1); |
return (1); |