X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=imap-send.c;h=e40125a22b72544c107e365d4f09eaa3b1ce53de;hb=96e33609974a79e6826dc62d008a8bc9c0923612;hp=80e0e8c051ad26a3a1353a4beb21e5c6ebdd6823;hpb=0d5708594310c2603682f16cfcb742c3f11704f4;p=git.git diff --git a/imap-send.c b/imap-send.c index 80e0e8c05..e40125a22 100644 --- a/imap-send.c +++ b/imap-send.c @@ -25,6 +25,7 @@ #include "cache.h" #include "exec_cmd.h" #include "run-command.h" +#include "prompt.h" #ifdef NO_OPENSSL typedef void *SSL; #else @@ -1208,13 +1209,10 @@ static struct store *imap_open_store(struct imap_server_conf *srvc) goto bail; } if (!srvc->pass) { - char prompt[80]; - sprintf(prompt, "Password (%s@%s): ", srvc->user, srvc->host); - arg = git_getpass(prompt); - if (!arg) { - perror("getpass"); - exit(1); - } + struct strbuf prompt = STRBUF_INIT; + strbuf_addf(&prompt, "Password (%s@%s): ", srvc->user, srvc->host); + arg = git_getpass(prompt.buf); + strbuf_release(&prompt); if (!*arg) { fprintf(stderr, "Skipping account %s@%s, no password\n", srvc->user, srvc->host); goto bail; @@ -1538,6 +1536,8 @@ int main(int argc, char **argv) git_extract_argv0_path(argv[0]); + git_setup_gettext(); + if (argc != 1) usage(imap_send_usage);