]> jfr.im git - irc/rqf/shadowircd.git/commitdiff
[svn] Remove emptyline craq because it leaks memory on /rehash motd etc.
authorjilles <redacted>
Wed, 2 May 2007 19:56:40 +0000 (12:56 -0700)
committerjilles <redacted>
Wed, 2 May 2007 19:56:40 +0000 (12:56 -0700)
from ratbox 2.2 (anfl/Androsyn)

ChangeLog
include/serno.h
src/cache.c

index f268389fc433ae80c8b9835eef243c5ed54a681e..a3b76dbd9481b0704d7504ea7265e51b0be22e42 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+jilles      2007/04/28 23:47:25 UTC    (20070428-3434)
+  Log:
+  Merge old trunk r2767:
+  Copy channel name from command on lowerTS JOIN/SJOIN,
+  this makes the capitalization of the channel name
+  timestamped like modes are.
+  
+
+  Changes:     Modified:
+  +3 -0                trunk/modules/core/m_join.c (File Modified) 
+  +3 -0                trunk/modules/core/m_sjoin.c (File Modified) 
+
+
 jilles      2007/04/26 23:01:16 UTC    (20070426-3432)
   Log:
   Merge old trunk r2065,r2067:
index c17ce25a0e3e0dd4488ec29dc5f608525bbada8d..e0ca67a6fc609b5ada89eaa48705d333fae411d3 100644 (file)
@@ -1 +1 @@
-#define SERNO "20070426-3432"
+#define SERNO "20070428-3434"
index d8ac748e9f162317ccd63b00b42a762bfb0fcf65..0a23ebbcc9ef70777d0af03149d2a06be19e3979 100644 (file)
@@ -29,7 +29,7 @@
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  *
- * $Id: cache.c 254 2005-09-21 23:35:12Z nenolod $
+ * $Id: cache.c 3436 2007-05-02 19:56:40Z jilles $
  */
 
 #include "stdinc.h"
@@ -50,7 +50,6 @@ static BlockHeap *cacheline_heap = NULL;
 
 struct cachefile *user_motd = NULL;
 struct cachefile *oper_motd = NULL;
-struct cacheline *emptyline = NULL;
 dlink_list links_cache_list;
 char user_motd_changed[MAX_DATE_STRING];
 
@@ -66,10 +65,6 @@ init_cache(void)
        cachefile_heap = BlockHeapCreate(sizeof(struct cachefile), CACHEFILE_HEAP_SIZE);
        cacheline_heap = BlockHeapCreate(sizeof(struct cacheline), CACHELINE_HEAP_SIZE);
 
-       /* allocate the emptyline */
-       emptyline = BlockHeapAlloc(cacheline_heap);
-       emptyline->data[0] = ' ';
-       emptyline->data[1] = '\0';
        user_motd_changed[0] = '\0';
 
        user_motd = cache_file(MPATH, "ircd.motd", 0);
@@ -124,14 +119,12 @@ cache_file(const char *filename, const char *shortname, int flags)
                if((p = strchr(line, '\n')) != NULL)
                        *p = '\0';
 
-               if(!EmptyString(line))
-               {
-                       lineptr = BlockHeapAlloc(cacheline_heap);
-                       strlcpy(lineptr->data, line, sizeof(lineptr->data));
-                       dlinkAddTail(lineptr, &lineptr->linenode, &cacheptr->contents);
-               }
+               lineptr = BlockHeapAlloc(cacheline_heap);
+               if(EmptyString(line))
+                       strlcpy(lineptr->data, " ", sizeof(lineptr->data));
                else
-                       dlinkAddTailAlloc(emptyline, &cacheptr->contents);
+                       strlcpy(lineptr->data, line, sizeof(lineptr->data));
+               dlinkAddTail(lineptr, &lineptr->linenode, &cacheptr->contents);
        }
 
        fclose(in);
@@ -192,8 +185,7 @@ free_cachefile(struct cachefile *cacheptr)
 
        DLINK_FOREACH_SAFE(ptr, next_ptr, cacheptr->contents.head)
        {
-               if(ptr->data != emptyline)
-                       BlockHeapFree(cacheline_heap, ptr->data);
+               BlockHeapFree(cacheline_heap, ptr->data);
        }
 
        BlockHeapFree(cachefile_heap, cacheptr);