Commit 2ed64e1f authored by Salvatore Sanfilippo's avatar Salvatore Sanfilippo
Browse files

Merge pull request #1192 from badboy/ipv6-rediscli

Wrap IPv6 in brackets in the prompt.
parents 73ae8558 1b696dc0
...@@ -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