Copyright dates 2014, 2015
[exim.git] / src / src / lookups / redis.c
index 91bd41feea234184365b1b03bd6b145b8ad28d4a..854d4162a7b4bdc2d5476f0ee8189d02c8643326 100644 (file)
@@ -2,12 +2,12 @@
 *     Exim - an Internet mail transport agent    *
 *************************************************/
 
-/* Copyright (c) University of Cambridge 1995 - 2009 */
+/* Copyright (c) University of Cambridge 1995 - 2015 */
 /* See the file NOTICE for conditions of use and distribution. */
 
 #include "../exim.h"
 
-#ifdef EXPERIMENTAL_REDIS
+#ifdef LOOKUP_REDIS
 
 #include "lf_functions.h"
 
@@ -118,7 +118,7 @@ if (sdata[2][0] == 0) sdata[2] = NULL;
 
 /* See if we have a cached connection to the server */
 
-for (cn = redis_connections; cn != NULL; cn = cn->next)
+for (cn = redis_connections; cn; cn = cn->next)
   if (Ustrcmp(cn->server, server_copy) == 0)
     {
     redis_handle = cn->handle;
@@ -209,13 +209,13 @@ if(sdata[1])
   {
   uschar * argv[32];
   int i;
-  const uschar * s;
+  const uschar * s = command;
   int siz, ptr;
   uschar c;
 
   while (isspace(*s)) s++;
 
-  for (s = command, i = 0; *s && i < nele(argv); i++)
+  for (i = 0; *s && i < nele(argv); i++)
     {
     for (argv[i] = NULL, siz = ptr = 0; (c = *s) && !isspace(c); s++)
       if (c != '\\' || *++s)           /* backslash protects next char */
@@ -458,11 +458,11 @@ static lookup_info redis_lookup_info = {
 };
 
 #ifdef DYNLOOKUP
-#define redis_lookup_module_info _lookup_module_info
+# define redis_lookup_module_info _lookup_module_info
 #endif /* DYNLOOKUP */
 
 static lookup_info *_lookup_list[] = { &redis_lookup_info };
 lookup_module_info redis_lookup_module_info = { LOOKUP_MODULE_INFO_MAGIC, _lookup_list, 1 };
 
-#endif /* EXPERIMENTAL_REDIS */
+#endif /* LOOKUP_REDIS */
 /* End of lookups/redis.c */