]> granicus.if.org Git - transmission/commitdiff
(libT) update the rename callback to include the previous torrent name
authorMitchell Livingston <livings124@transmissionbt.com>
Tue, 22 Jan 2013 00:43:50 +0000 (00:43 +0000)
committerMitchell Livingston <livings124@transmissionbt.com>
Tue, 22 Jan 2013 00:43:50 +0000 (00:43 +0000)
libtransmission/torrent.c

index 21e26648ec29250868b81f2f99870f8f7cd6eed4..395a63c3dcfdc6351c282f1030f4509f6b3cfb5b 100644 (file)
@@ -3548,17 +3548,18 @@ torrentRename (void * vdata)
   int error = 0;
   struct rename_data * data = vdata;
   tr_torrent * const tor = data->tor;
+  char * const oldname = tor->info.name;
 
-  tr_free (tor->info.name);
   tor->info.name = data->newname;
   tr_torrentSetDirty (tor);
   tor->anyDate = tr_time ();
 
   /* callback */
   if (data->callback != NULL)
-    (*data->callback)(tor, data->oldpath, data->newname, error, data->callback_user_data);
+    (*data->callback)(tor, oldname, data->newname, error, data->callback_user_data);
 
   /* cleanup */
+  tr_free (oldname);
   tr_free (data);
 }