소스 검색

* Fixed ANSI colors not showing for logs when bot is not in background.

svn: 2175
Bryan Drewery 21 년 전
부모
커밋
b41d210aec
2개의 변경된 파일8개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 0
      doc/UPDATES
  2. 7 1
      src/dccutil.c

+ 1 - 0
doc/UPDATES

@@ -155,6 +155,7 @@ Lines prefixed with '-' were disabled before release and are not finished, or ar
 * cmd_dump now has a substitution. '$n' is replaced with the bot's current IRC nick.
 * Added rate var 'flood-g' which will set +g for 60 seconds after this many msgs:sec has been detected. (#74)
 * Disabled all memory allocations after a segfault (Fixes CPU spinning)
+* Fixed ANSI colors not showing for logs when bot is not in background.
 
 1.2.2
 * Don't sanity check flags for users on DCC CHAT if they are on the bot via .botcmd.

+ 7 - 1
src/dccutil.c

@@ -240,6 +240,12 @@ dprintf(int idx, const char *format, ...)
   if (idx < 0) {
     tputs(-idx, buf, len);
   } else if (idx > 0x7FF0) {
+    if (idx == DP_LOG || idx == DP_STDOUT || idx == DP_STDOUT) {
+      colorbuf(buf, len, -1);
+      buf[sizeof(buf) - 1] = 0;
+      len = strlen(buf);
+    }
+
     switch (idx) {
       case DP_LOG:
         putlog(LOG_MISC, "*", "%s", buf);
@@ -975,7 +981,7 @@ int check_cmd_pass(const char *cmd, char *pass)
     if (!egg_strcasecmp(cmd, cp->name)) {
       char tmp[32] = "";
 
-      encrypt_pass(pass, tmp);
+      encrypt_cmd_pass(pass, tmp);
       if (!strcmp(tmp, cp->pass))
         return 1;
       return 0;