[Exim] list tab patch

Top Page
Delete this message
Reply to this message
Author: Geraint A Edwards
Date:  
To: exim-users
Subject: [Exim] list tab patch
Hi,

I'm testing Exim 4.00 (enticed by the very useful possibilities
added since 3.x). It's interesting so far - not live yet, but
nearly there.

However, I did notice a small problem with the new "list"
definitions. Take the below as an example:

    domainlist local_domains = @


Exim was fine if that line matches "list<space>", but didn't like
me putting a tab right after "domainlist", claiming:

    2002-02-28 21:47:48 Exim configuration error in line 27:
      main option "domainlist" unknown


That struck me as not quite right!


So I wrote a patch and submit it below for other obsessive tab
formatters to try out. Tested on my (FreeBSD) box from source,
YMMV.

To allow tabs and other whitespace after "...list" I effectively
did:

    # remove build symlinks
    rm build*/readconf.c build*/mytypes.h
    # copy source
    cp src/readconf.c src/mytypes.h build*


then applied the following patch:


--- ../src/readconf.c    Thu Feb 28 23:50:28 2002
+++ readconf.c    Thu Feb 28 23:53:58 2002
@@ -2261,19 +2261,19 @@
     m->replacement = string_copy(s);
     }


-  else if (Ustrncmp(s, "domainlist ", 11) == 0)
+  else if (CWordSpace(s, "domainlist"))
     read_named_list(&domainlist_anchor, &domainlist_count,
       MAX_NAMED_LIST, s+11, US"domain list");


-  else if (Ustrncmp(s, "hostlist ", 9) == 0)
+  else if (CWordSpace(s, "hostlist"))
     read_named_list(&hostlist_anchor, &hostlist_count,
       MAX_NAMED_LIST, s+9, US"host list");


-  else if (Ustrncmp(s, US"addresslist ", 12) == 0)
+  else if (CWordSpace(s, "addresslist"))
     read_named_list(&addresslist_anchor, &addresslist_count,
       MAX_NAMED_LIST, s+12, US"address list");


-  else if (Ustrncmp(s, US"localpartlist ", 14) == 0)
+  else if (CWordSpace(s, "localpartlist"))
     read_named_list(&localpartlist_anchor, &localpartlist_count,
       MAX_NAMED_LIST, s+14, US"local part list");


--- ../src/mytypes.h    Thu Feb 28 23:50:41 2002
+++ mytypes.h    Thu Feb 28 23:54:05 2002
@@ -80,6 +80,9 @@
 #define Ustrtoul(s,t,b)    strtoul(CS(s),CSS(t),b)
 #define Uunlink(s)         unlink(CS(s))


+#define CWordSpace(s,w) ((Ustrncmp(s, w, Ustrlen(w)) == 0) && isspace(*(s+Ustrlen(w))))
+
+
#endif

/* End of mytypes.h */

--
Geraint A. Edwards  "Gedge"       Caerdydd(Cardiff), Cymru(Wales)
gedge@???      IRCNet:Gedge  http://serf.org/gedge/