/[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 213 by twoaday, Mon Apr 17 09:12:50 2006 UTC revision 214 by twoaday, Sun May 14 18:40:36 2006 UTC
# Line 247  gnupg_load_config (void) Line 247  gnupg_load_config (void)
247  }  }
248    
249    
250    /* handle the case the user added a '!' to force a subkey. */
251    static char*
252    extract_keyid (const char *val)
253    {    
254        size_t len = strlen (val);
255    
256        if (len > 1 && val[len-1] == '!') {
257            char *p = new char[len+1];
258            if (!p)
259                BUG (0);
260            memset (p, 0, len+1);
261            memcpy (p, val, len-1);
262            return p;
263        }
264        return m_strdup (val);
265    }
266    
267    
268  char*  char*
269  get_gnupg_default_key (void)  get_gnupg_default_key (void)
270  {      {    
# Line 267  get_gnupg_default_key (void) Line 285  get_gnupg_default_key (void)
285      if (!e)      if (!e)
286          e = find_option (opt, "local-user");          e = find_option (opt, "local-user");
287      if (e)      if (e)
288          keyid = m_strdup (e->val);          keyid = extract_keyid (e->val);
289    
290      free_if_alloc (optfile);      free_if_alloc (optfile);
291      release_gpg_options (opt);      release_gpg_options (opt);

Legend:
Removed from v.213  
changed lines
  Added in v.214

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26