2006-07-16 Marcus Brinkmann <marcus@g10code.de>
authorMarcus Brinkmann <mb@g10code.com>
Sun, 16 Jul 2006 13:25:19 +0000 (13:25 +0000)
committerMarcus Brinkmann <mb@g10code.com>
Sun, 16 Jul 2006 13:25:19 +0000 (13:25 +0000)
* data.c (gpgme_data_set_file_name): Allow to clear the file name
by passing NULL.

gpgme/ChangeLog
gpgme/data.c

index d1342550574226254efda039a73bf781735fa14a..23e0e56c8c726d4fa95022dd67656dfcddb6556e 100644 (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>
 
        * keylist.c (gpgme_get_key): Also clone the engine info.
index 3f38bd32119c467859f0927184897e3848f8af4a..788aaf0b07d6365b134849e398ee4fdb51d2615a 100644 (file)
@@ -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;
 }