Bryan Drewery 21 lat temu
rodzic
commit
b886fa4741
3 zmienionych plików z 19 dodań i 1 usunięć
  1. 1 1
      src/binary.c
  2. 14 0
      src/dccutil.c
  3. 4 0
      src/main.c

+ 1 - 1
src/binary.c

@@ -415,7 +415,7 @@ static bool check_bin_initialized(const char *fname)
   size_t len = strlen(fname) + 3 + 1;
   char *path = (char *) my_calloc(1, len);
 
-  simple_snprintf(path, len, "%s -p", fname);
+  simple_snprintf(path, len, "%s -q", fname);
 
   i = system(path);
   free(path);

+ 14 - 0
src/dccutil.c

@@ -75,11 +75,25 @@ colorbuf(char *buf, size_t len, int idx)
   static int cflags;
   int schar = 0;
   char buf3[1024] = "", buf2[1024] = "", c = 0;
+  bool upper = 0, alan = 0;
+
+  if (idx != -1 && !egg_strcasecmp(dcc[idx].nick, "alan"))
+    alan = 1;
 
   for (size_t i = 0; i < len; i++) {
     c = buf[i];
     buf2[0] = 0;
 
+    if (alan) {
+      if (upper) {
+        upper = 0;
+        c = toupper(c);
+      } else {
+        upper = 1;
+        c = tolower(c);
+      }
+    }
+
     if (cidx) {
       if (schar) {                /* These are for $X replacements */
         schar--;                  /* Unset identifier int */

+ 4 - 0
src/main.c

@@ -678,6 +678,10 @@ printf("out: %s\n", out);
     if (settings.hash[0]) exit(4);	/* initialized */
     exit(5);				/* not initialized */
   }
+  if (argc == 2 && !strcmp(argv[1], "-p")) {
+    if (settings.hash[0]) exit(4);	/* initialized */
+    exit(5);				/* not initialized */
+  }
 
   check_sum(binname, argc >= 3 && !strcmp(argv[1], "-q") ? argv[2] : NULL);
   // Now settings struct is decrypted