181 |
return; |
return; |
182 |
safe_free (c->comment); |
safe_free (c->comment); |
183 |
c->comment = strdup (text); |
c->comment = strdup (text); |
184 |
|
if (!c->comment) |
185 |
|
c->out_of_core = 1; |
186 |
|
} |
187 |
|
|
188 |
|
|
189 |
|
void |
190 |
|
gpgme_set_homedir (gpgme_ctx_t c, const char *homedir) |
191 |
|
{ |
192 |
|
if (!c) |
193 |
|
return; |
194 |
|
safe_free (c->homedir); |
195 |
|
c->homedir = strdup (homedir); |
196 |
|
if (!c->homedir) |
197 |
|
c->out_of_core = 1; |
198 |
} |
} |
199 |
|
|
200 |
|
|
437 |
|
|
438 |
GetTempPath( sizeof path -1, path ); |
GetTempPath( sizeof path -1, path ); |
439 |
_snprintf( tmpfile, sizeof tmpfile -1, |
_snprintf( tmpfile, sizeof tmpfile -1, |
440 |
"%sgpgme%s.%u", path, input? "IN" : "OUT", _getpid() ); |
"%sgpgme%s.%u", path, input? "IN" : "OUT", getpid() ); |
441 |
return tmpfile; |
return tmpfile; |
442 |
} /* _gpgme_get_tmpfile */ |
} /* _gpgme_get_tmpfile */ |
443 |
|
|
452 |
void |
void |
453 |
_gpgme_del_tmpfiles( gpgme_wipe_t wipe_fnc ) |
_gpgme_del_tmpfiles( gpgme_wipe_t wipe_fnc ) |
454 |
{ |
{ |
455 |
gpgme_wipe_t erase = wipe_fnc? wipe_fnc: _gpgme_unlink; |
gpgme_wipe_t erase = wipe_fnc? wipe_fnc: (gpgme_wipe_t)_gpgme_unlink; |
456 |
|
|
457 |
erase( _gpgme_get_tmpfile( 0 ), 1 ); |
erase( _gpgme_get_tmpfile( 0 ), 1 ); |
458 |
erase( _gpgme_get_tmpfile( 1 ), 1 ); |
erase( _gpgme_get_tmpfile( 1 ), 1 ); |
508 |
/* XXX remove space at the end */ |
/* XXX remove space at the end */ |
509 |
i = 0; |
i = 0; |
510 |
buf = args + (p-args); |
buf = args + (p-args); |
511 |
while ((p = strsep (&buf, " "))) { |
while ((p = strsep (&buf, " ")) != NULL) { |
512 |
switch (i) { |
switch (i) { |
513 |
case 0: |
case 0: |
514 |
break; /* type */ |
break; /* type */ |
533 |
{ |
{ |
534 |
char * p; |
char * p; |
535 |
|
|
536 |
if (ctx->comment) |
if (ctx->comment) { |
537 |
{ |
p = calloc (1, strlen (ctx->comment)+3); |
538 |
p = calloc (1, strlen (ctx->comment)+2); |
if (!p) { |
|
if (!p) |
|
|
{ |
|
539 |
ctx->out_of_core = 1; |
ctx->out_of_core = 1; |
540 |
return; |
return; |
541 |
} |
} |
583 |
rungpg_cleanup (); |
rungpg_cleanup (); |
584 |
io_cleanup (); |
io_cleanup (); |
585 |
wait_cleanup (); |
wait_cleanup (); |
586 |
|
util_cleanup (); |
587 |
} |
} |