* Set the prompt */
| 265 | * Set the prompt |
| 266 | */ |
| 267 | int |
| 268 | rl_set_prompt(const char *prompt) |
| 269 | { |
| 270 | char *p; |
| 271 | |
| 272 | if (!prompt) |
| 273 | prompt = ""; |
| 274 | if (rl_prompt != NULL && strcmp(rl_prompt, prompt) == 0) |
| 275 | return 0; |
| 276 | if (rl_prompt) |
| 277 | el_free(rl_prompt); |
| 278 | rl_prompt = strdup(prompt); |
| 279 | if (rl_prompt == NULL) |
| 280 | return -1; |
| 281 | |
| 282 | while ((p = strchr(rl_prompt, RL_PROMPT_END_IGNORE)) != NULL) |
| 283 | *p = RL_PROMPT_START_IGNORE; |
| 284 | |
| 285 | return 0; |
| 286 | } |
| 287 | |
| 288 | /* |
| 289 | * initialize rl compat stuff |
no outgoing calls
no test coverage detected