Debian Codegraph @

debian/patches/singpolyma-0002-Generalize-get_password.patch

raw
1 From a1c765a2cb08f49d31c70e5e6fbfba4190eb126e Mon Sep 17 00:00:00 2001
2 From: Stephen Paul Weber <[email protected]>
3 Date: Thu, 21 Apr 2011 00:10:40 -0500
4 Subject: [PATCH 02/18] Generalize get_password
5
6 So that we can use it to get other passwords as well.
7 ---
8 src/core/xmpp-servers.c | 10 +++++-----
9 src/core/xmpp-servers.h | 5 +++--
10 2 files changed, 8 insertions(+), 7 deletions(-)
11
12 --- a/src/core/xmpp-servers.c
13 +++ b/src/core/xmpp-servers.c
14 @@ -282,8 +282,8 @@
15 * Displays input prompt on command line and takes input data from user
16 * From irssi-silc (silc-client/lib/silcutil/silcutil.c)
17 */
18 -static char *
19 -get_password()
20 +char *
21 +get_password(char *prompt)
22 {
23 char input[2048], *ret = NULL;
24 int fd;
25 @@ -310,7 +310,7 @@
26 to.c_cc[VMIN] = 255;
27 tcsetattr(fd, TCSANOW, &to);
28
29 - printf("\tXMPP Password: ");
30 + printf("\n\n%s", prompt);
31 fflush(stdout);
32
33 memset(input, 0, sizeof(input));
34 @@ -334,6 +334,7 @@
35 ret = g_strdup(input);
36 memset(input, 0, sizeof(input));
37 #endif /* DISABLE_TERMIOS */
38 + signal_emit("send command", 1, "redraw");
39 return ret;
40 }
41
42 @@ -373,8 +374,7 @@
43 || *(server->connrec->password) == '\0'
44 || *(server->connrec->password) == '\r') {
45 g_free_not_null(server->connrec->password);
46 - server->connrec->prompted_password = get_password();
47 - signal_emit("send command", 1, "redraw");
48 + server->connrec->prompted_password = get_password("XMPP Password: ");
49 if (server->connrec->prompted_password != NULL)
50 server->connrec->password =
51 g_strdup(server->connrec->prompted_password);
52 --- a/src/core/xmpp-servers.h
53 +++ b/src/core/xmpp-servers.h
54 @@ -58,8 +58,9 @@
55 SERVER_REC *xmpp_server_init_connect(SERVER_CONNECT_REC *);
56 void xmpp_server_connect(XMPP_SERVER_REC *);
57
58 -void xmpp_servers_init(void);
59 -void xmpp_servers_deinit(void);
60 +void xmpp_servers_init(void);
61 +void xmpp_servers_deinit(void);
62 +char *get_password(char *prompt);
63 __END_DECLS
64
65 #endif