From c7762497febcf1d1681d57b02929bad7903827d3 Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Sun, 16 Jul 2006 13:25:19 +0000 Subject: [PATCH] 2006-07-16 Marcus Brinkmann * data.c (gpgme_data_set_file_name): Allow to clear the file name by passing NULL. --- gpgme/ChangeLog | 5 +++++ gpgme/data.c | 11 ++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/gpgme/ChangeLog b/gpgme/ChangeLog index d1342550..23e0e56c 100644 --- a/gpgme/ChangeLog +++ b/gpgme/ChangeLog @@ -1,3 +1,8 @@ +2006-07-16 Marcus Brinkmann + + * data.c (gpgme_data_set_file_name): Allow to clear the file name + by passing NULL. + 2006-06-22 Marcus Brinkmann * keylist.c (gpgme_get_key): Also clone the engine info. diff --git a/gpgme/data.c b/gpgme/data.c index 3f38bd32..788aaf0b 100644 --- a/gpgme/data.c +++ b/gpgme/data.c @@ -183,9 +183,14 @@ gpgme_data_set_file_name (gpgme_data_t dh, const char *file_name) if (dh->file_name) free (dh->file_name); - dh->file_name = strdup (file_name); - if (!dh->file_name) - return gpg_error_from_errno (errno); + if (file_name) + { + dh->file_name = strdup (file_name); + if (!dh->file_name) + return gpg_error_from_errno (errno); + } + else + dh->file_name = 0; return 0; }