From 11d60307cf8c3abfa02657367dc764d545576157 Mon Sep 17 00:00:00 2001 From: Jordan Lee Date: Thu, 3 Feb 2011 17:37:53 +0000 Subject: [PATCH] (trunk libT) #3967 "regression: transmission-daemon's non-inotify watchdir is broken in 2.20 betas" -- fixed. When inotify isn't available, watch.c uses readdir() to look for new .torrent files. It keeps a list of old .torrent files internally so that it doesn't try to keep re-adding the same file. This list is stored in an evbuffer. As part of the libevent2 upgrade (#3836), r11594 changed how the buffer is searched by replacing the (deprecated) event_find() call with libevent2's evbuffer_search(). However the latter's semantics are different in that searching stops when '\0' is reached, so '\0' is no longer a good filename delimiter. Fixed by changing watch.c's internal delimiter from '\0' to '\t' ... so all those torrents with tabs in their filenames had better watch out. --- daemon/watch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon/watch.c b/daemon/watch.c index c43064a29..3621798fe 100644 --- a/daemon/watch.c +++ b/daemon/watch.c @@ -153,7 +153,7 @@ watchdir_update_impl( dtr_watchdir * w ) #define WATCHDIR_POLL_INTERVAL_SECS 10 -#define FILE_DELIMITER '\0' +#define FILE_DELIMITER '\t' static void watchdir_new_impl( dtr_watchdir * w UNUSED )