2006-07-16 Marcus Brinkmann <marcus@g10code.de>

* data.c (gpgme_data_set_file_name): Allow to clear the file name
	by passing NULL.
This commit is contained in:
Marcus Brinkmann 2006-07-16 13:25:19 +00:00
parent 1ae2788117
commit c7762497fe
2 changed files with 13 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2006-07-16 Marcus Brinkmann <marcus@g10code.de>
* data.c (gpgme_data_set_file_name): Allow to clear the file name
by passing NULL.
2006-06-22 Marcus Brinkmann <marcus@g10code.de> 2006-06-22 Marcus Brinkmann <marcus@g10code.de>
* keylist.c (gpgme_get_key): Also clone the engine info. * keylist.c (gpgme_get_key): Also clone the engine info.

View File

@ -183,9 +183,14 @@ gpgme_data_set_file_name (gpgme_data_t dh, const char *file_name)
if (dh->file_name) if (dh->file_name)
free (dh->file_name); free (dh->file_name);
dh->file_name = strdup (file_name); if (file_name)
if (!dh->file_name) {
return gpg_error_from_errno (errno); dh->file_name = strdup (file_name);
if (!dh->file_name)
return gpg_error_from_errno (errno);
}
else
dh->file_name = 0;
return 0; return 0;
} }