Commit 1b696dc0 authored by Jan-Erik Rediger's avatar Jan-Erik Rediger
Browse files

Wrap IPv6 in brackets in the prompt.

parent 73ae8558
...@@ -116,7 +116,8 @@ static void cliRefreshPrompt(void) { ...@@ -116,7 +116,8 @@ static void cliRefreshPrompt(void) {
len = snprintf(config.prompt,sizeof(config.prompt),"redis %s", len = snprintf(config.prompt,sizeof(config.prompt),"redis %s",
config.hostsocket); config.hostsocket);
else else
len = snprintf(config.prompt,sizeof(config.prompt),"redis %s:%d", len = snprintf(config.prompt,sizeof(config.prompt),
strchr(config.hostip,':') ? "[%s]:%d" : "%s:%d",
config.hostip, config.hostport); config.hostip, config.hostport);
/* Add [dbnum] if needed */ /* Add [dbnum] if needed */
if (config.dbnum != 0) if (config.dbnum != 0)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment