Merge branch 'js/gnome-keyring'
Style fix. * js/gnome-keyring: contrib/git-credential-gnome-keyring.c: small stylistic cleanups
This commit is contained in:
@ -130,8 +130,7 @@ static GnomeKeyringResult gnome_keyring_item_delete_sync(const char *keyring, gu
|
||||
/*
|
||||
* This credential struct and API is simplified from git's credential.{h,c}
|
||||
*/
|
||||
struct credential
|
||||
{
|
||||
struct credential {
|
||||
char *protocol;
|
||||
char *host;
|
||||
unsigned short port;
|
||||
@ -140,19 +139,16 @@ struct credential
|
||||
char *password;
|
||||
};
|
||||
|
||||
#define CREDENTIAL_INIT \
|
||||
{ NULL,NULL,0,NULL,NULL,NULL }
|
||||
#define CREDENTIAL_INIT { NULL, NULL, 0, NULL, NULL, NULL }
|
||||
|
||||
typedef int (*credential_op_cb)(struct credential *);
|
||||
|
||||
struct credential_operation
|
||||
{
|
||||
struct credential_operation {
|
||||
char *name;
|
||||
credential_op_cb op;
|
||||
};
|
||||
|
||||
#define CREDENTIAL_OP_END \
|
||||
{ NULL,NULL }
|
||||
#define CREDENTIAL_OP_END { NULL, NULL }
|
||||
|
||||
/* ----------------- GNOME Keyring functions ----------------- */
|
||||
|
||||
@ -298,8 +294,7 @@ static int keyring_erase(struct credential *c)
|
||||
if (result == GNOME_KEYRING_RESULT_CANCELLED)
|
||||
return EXIT_SUCCESS;
|
||||
|
||||
if (result != GNOME_KEYRING_RESULT_OK)
|
||||
{
|
||||
if (result != GNOME_KEYRING_RESULT_OK) {
|
||||
g_critical("%s", gnome_keyring_result_to_message(result));
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
@ -312,8 +307,7 @@ static int keyring_erase(struct credential *c)
|
||||
|
||||
gnome_keyring_network_password_list_free(entries);
|
||||
|
||||
if (result != GNOME_KEYRING_RESULT_OK)
|
||||
{
|
||||
if (result != GNOME_KEYRING_RESULT_OK) {
|
||||
g_critical("%s", gnome_keyring_result_to_message(result));
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
@ -325,8 +319,7 @@ static int keyring_erase(struct credential *c)
|
||||
* Table with helper operation callbacks, used by generic
|
||||
* credential helper main function.
|
||||
*/
|
||||
static struct credential_operation const credential_helper_ops[] =
|
||||
{
|
||||
static struct credential_operation const credential_helper_ops[] = {
|
||||
{ "get", keyring_get },
|
||||
{ "store", keyring_store },
|
||||
{ "erase", keyring_erase },
|
||||
@ -360,8 +353,7 @@ static int credential_read(struct credential *c)
|
||||
|
||||
key = buf = gnome_keyring_memory_alloc(1024);
|
||||
|
||||
while (fgets(buf, 1024, stdin))
|
||||
{
|
||||
while (fgets(buf, 1024, stdin)) {
|
||||
line_len = strlen(buf);
|
||||
|
||||
if (line_len && buf[line_len-1] == '\n')
|
||||
@ -398,7 +390,8 @@ static int credential_read(struct credential *c)
|
||||
} else if (!strcmp(key, "password")) {
|
||||
gnome_keyring_memory_free(c->password);
|
||||
c->password = gnome_keyring_memory_strdup(value);
|
||||
while (*value) *value++ = '\0';
|
||||
while (*value)
|
||||
*value++ = '\0';
|
||||
}
|
||||
/*
|
||||
* Ignore other lines; we don't know what they mean, but
|
||||
|
Reference in New Issue
Block a user