Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
1bcbb7a9
Commit
1bcbb7a9
authored
Jul 11, 2013
by
Jan-Erik Rediger
Committed by
antirez
Jul 12, 2013
Browse files
Wrap IPv6 in brackets in the prompt.
parent
1e23848e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/redis-cli.c
View file @
1bcbb7a9
...
@@ -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)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment