/[winpt]/trunk/Src/wptGPG.cpp
ViewVC logotype

Diff of /trunk/Src/wptGPG.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 175 by twoaday, Tue Feb 7 08:58:04 2006 UTC revision 179 by twoaday, Fri Feb 24 13:12:26 2006 UTC
# Line 554  leave: Line 554  leave:
554  } /* get_gnupg_config */  } /* get_gnupg_config */
555    
556    
557    /* Set the default key in the gpg.conf.
558       If @key is NULL, the entry will be deleted. */
559  int  int
560  set_gnupg_default_key (const char * key)  set_gnupg_default_key (const char *key)
561  {  {
562      gpg_optfile_t opt;      gpg_optfile_t opt;
563      gpg_option_t e;      gpg_option_t e;
# Line 564  set_gnupg_default_key (const char * key) Line 566  set_gnupg_default_key (const char * key)
566    
567      optfile = get_gnupg_cfgfile ();      optfile = get_gnupg_cfgfile ();
568      if (!optfile)      if (!optfile)
569          return -1;          return WPTERR_FILE_OPEN;
570      rc = parse_gpg_options (optfile, &opt);      rc = parse_gpg_options (optfile, &opt);
571      if( rc ) {      if (rc) {
572          free_if_alloc (optfile);          free_if_alloc (optfile);
573          return -1;          return WPTERR_GENERAL;
574      }      }
575      e = find_option (opt, "default-key");      e = find_option (opt, "default-key");
576      if (e) {      if (e && !key)
577            e->used = 0;
578        else if (e) {
579          free_if_alloc (e->val);          free_if_alloc (e->val);
580          e->val = m_strdup (key);          e->val = m_strdup (key);
581          e->used = 1;          e->used = 1;
# Line 584  set_gnupg_default_key (const char * key) Line 588  set_gnupg_default_key (const char * key)
588      release_gpg_options (opt);      release_gpg_options (opt);
589    
590      return rc;      return rc;
591  } /* set_gnupg_default_key */  }
592    
593    
594  /*  /*

Legend:
Removed from v.175  
changed lines
  Added in v.179

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26