summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 27e3219)
raw | patch | inline | side by side (parent: 27e3219)
author | Johannes Schindelin <johannes.schindelin@gmx.de> | |
Sat, 23 May 2009 08:04:50 +0000 (10:04 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 23 May 2009 08:54:45 +0000 (01:54 -0700) |
We need getpass() to activate curl on MinGW. Although the default
Makefile currently has 'NO_CURL = YesPlease', msysgit releases do
provide curl support, so getpass() is used.
[spr: - edited commit message.
- squashed commit that provides getpass() declaration.]
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile currently has 'NO_CURL = YesPlease', msysgit releases do
provide curl support, so getpass() is used.
[spr: - edited commit message.
- squashed commit that provides getpass() declaration.]
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/mingw.c | patch | blob | history | |
compat/mingw.h | patch | blob | history |
diff --git a/compat/mingw.c b/compat/mingw.c
index b723c4dfd63ef3021e47419bd2dbe570b8ec7b11..e190fddf41d6b15d9254859fca8b638ed7c0f428 100644 (file)
--- a/compat/mingw.c
+++ b/compat/mingw.c
}
return 0;
}
+
+char *getpass(const char *prompt)
+{
+ struct strbuf buf = STRBUF_INIT;
+
+ fputs(prompt, stderr);
+ for (;;) {
+ char c = _getch();
+ if (c == '\r' || c == '\n')
+ break;
+ strbuf_addch(&buf, c);
+ }
+ fputs("\n", stderr);
+ return strbuf_detach(&buf, NULL);
+}
diff --git a/compat/mingw.h b/compat/mingw.h
index b1156b865ea8f145956f8fad1ea0dd6a4ea28c93..4c50f5b1bca1e161b7e6cf0635b57f5e8d741c13 100644 (file)
--- a/compat/mingw.h
+++ b/compat/mingw.h
char *pw_dir;
};
+extern char *getpass(const char *prompt);
+
struct pollfd {
int fd; /* file descriptor */
short events; /* requested events */