/soc/2012/michael/libpurple: 4dddef9bd1e0: Conditionally removed...

Michael Zangl michael at soc.pidgin.im
Thu May 9 05:53:19 EDT 2013


Changeset: 4dddef9bd1e00afa3989175170aeb14dcc1c99c9
Author:	 Michael Zangl <michael at soc.pidgin.im>
Date:	 2013-05-08 13:19 +0200
Branch:	 default
URL: https://hg.pidgin.im/soc/2012/michael/libpurple/rev/4dddef9bd1e0

Description:

Conditionally removed the getpass call in nullclient, because Android does not provide getpass.

diffstat:

 libpurple/example/nullclient.c |  11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diffs (22 lines):

diff --git a/libpurple/example/nullclient.c b/libpurple/example/nullclient.c
--- a/libpurple/example/nullclient.c
+++ b/libpurple/example/nullclient.c
@@ -297,7 +297,18 @@ int main(int argc, char *argv[])
 	account = purple_account_new(name, prpl);
 
 	/* Get the password for the account */
+	#ifdef ANDROID
+	/* Android does not have getpass */
+	printf("Password: ");
+	res = fgets(password, sizeof(password), stdin);
+	if (!res) {
+		fprintf(stderr, "Failed to read password.");
+		abort();
+	}
+	password[strlen(password) - 1] = 0;
+	#else
 	password = getpass("Password: ");
+	#endif
 	purple_account_set_password(account, password);
 
 	/* It's necessary to enable the account first. */



More information about the Commits mailing list