[ekg2-commit] r4024 - in trunk: ekg plugins/irc plugins/logsqlite: trunk/ekg/stuff.c trunk/plugins/irc/irc.c trunk/plugins/logsqlite/logsqlite.c

SVN commit svn w toxygen.net
Pon, 23 Cze 2008, 12:14:08 CEST


Author: wiechu
Date: 2008-06-23 12:14:07 +0200 (Mon, 23 Jun 2008)
New Revision: 4024

Modified:
   trunk/ekg/stuff.c
   trunk/plugins/irc/irc.c
   trunk/plugins/logsqlite/logsqlite.c
Log:
    Remove strip_quotes(), because array_make() do it.

Modified: trunk/ekg/stuff.c
===================================================================
--- trunk/ekg/stuff.c	2008-06-22 19:31:09 UTC (rev 4023)
+++ trunk/ekg/stuff.c	2008-06-23 10:14:07 UTC (rev 4024)
@@ -1310,36 +1310,6 @@
 }
 
 /**
- * strip_quotes()
- *
- * strips quotes from the begining and the end of string @a line
- *
- * @param line - given string ;-)
- * @sa strip_spaces - for spaces striping function
- *
- * @note If you pass here smth which was strdup'ed() malloc'ed() or smth which was allocated.<br>
- * 		You <b>must</b> xfree() string passed, not result of this function.
- *
- * @return buffer without quotes.
- */
-
-char *strip_quotes(char *line) {
-	size_t linelen;
-	char *buf;
-
-	if (!(linelen = xstrlen(line))) return line;
-
-	for (buf = line; *buf == '\"'; buf++);
-
-	while (linelen > 0 && line[linelen - 1] == '\"') {
-		line[linelen - 1] = 0;
-		linelen--;
-	}
-
-	return buf;
-}
-
-/**
  * strip_spaces()
  *
  * strips spaces from the begining and the end of string @a line

Modified: trunk/plugins/irc/irc.c
===================================================================
--- trunk/plugins/irc/irc.c	2008-06-22 19:31:09 UTC (rev 4023)
+++ trunk/plugins/irc/irc.c	2008-06-23 10:14:07 UTC (rev 4024)
@@ -2020,20 +2020,16 @@
 		return -1;
 	}
 
-	tmp = xstrdup(tar);
-	tmp = strip_quotes(tmp);
+	w = window_find_s(session, tar);
 
-	w = window_find_s(session, tmp);
-
 	if (!w) {
-		w = window_new(tmp, session, 0);
+		w = window_new(tar, session, 0);
 		if (session_int_get(session, "auto_lusers_sync") > 0)
-			watch_write(j->send_watch, "USERHOST %s\r\n", tmp+4);
+			watch_write(j->send_watch, "USERHOST %s\r\n", tar+4);
 	}
 
 	window_switch(w->id);
 
-	xfree(tmp);
 	array_free(mp);
         array_free(p);
 	xfree(tar);

Modified: trunk/plugins/logsqlite/logsqlite.c
===================================================================
--- trunk/plugins/logsqlite/logsqlite.c	2008-06-22 19:31:09 UTC (rev 4023)
+++ trunk/plugins/logsqlite/logsqlite.c	2008-06-23 10:14:07 UTC (rev 4024)
@@ -136,7 +136,6 @@
 	if (! (db = logsqlite_prepare_db(session, time(0), 0)))
 		return -1;
 
-	keep_nick = xstrdup(keep_nick);
 	sql_search = sql_search ? sql_search : "";	/* XXX: use fix() */
 #ifdef HAVE_SQLITE3
 	sql_search = sqlite3_mprintf("%%%s%%", sql_search);
@@ -144,7 +143,7 @@
 
 
 	if (keep_nick) {
-		nick = strip_quotes(keep_nick);
+		nick = keep_nick;
 		gotten_uid = get_uid(session, nick);
 		if (! gotten_uid) 
 			gotten_uid = nick;
@@ -277,8 +276,6 @@
 			print_window(target_window, session, config_logsqlite_last_open_window, "last_end_status");
 	}
 
-	xfree(keep_nick);
-
 #ifdef HAVE_SQLITE3
 	sqlite3_free(sql_search);
 	sqlite3_finalize(stmt);



Więcej informacji o liście dyskusyjnej ekg2-commit