]> jfr.im git - solanum.git/commitdiff
[svn] xline/resv wildcard checking:
authorjilles <redacted>
Mon, 4 Jun 2007 16:04:49 +0000 (09:04 -0700)
committerjilles <redacted>
Mon, 4 Jun 2007 16:04:49 +0000 (09:04 -0700)
- count escaped (\) characters as one nonwild
- accept strings without wilds no matter how short they are

ChangeLog
include/serno.h
src/s_newconf.c

index 7f7edf918f7748119e6e45bb8f492bd8feb5064f..bdc37c44e31e6633b04b57671bf1751bdaa4009f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+jilles      2007/05/30 10:22:25 UTC    (20070530-3498)
+  Log:
+  Tweak some comments in sno_whois extension.
+  
+
+  Changes:     Modified:
+  +2 -2                trunk/extensions/sno_whois.c (File Modified) 
+
+
 jilles      2007/05/30 10:22:01 UTC    (20070530-3496)
   Log:
   Tweak NEWS a little.
index 89e5f38b334fee11113537a9325fc0fc134a9ddb..3899a09e7f63967879fa67344104ec2cf39346e6 100644 (file)
@@ -1 +1 @@
-#define SERNO "20070530-3496"
+#define SERNO "20070530-3498"
index 66adbeca3ca56a49ed1eeb34b38b8cb58f2bec2d..4b5e1e087bf0df46067b82eb991338dffdeaa1b9 100644 (file)
@@ -29,7 +29,7 @@
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  *
- * $Id: s_newconf.c 3161 2007-01-25 07:23:01Z nenolod $
+ * $Id: s_newconf.c 3508 2007-06-04 16:04:49Z jilles $
  */
 
 #include "stdinc.h"
@@ -595,6 +595,7 @@ valid_wild_card_simple(const char *data)
        const char *p;
        char tmpch;
        int nonwild = 0;
+       int wild = 0;
 
        /* check the string for minimum number of nonwildcard chars */
        p = data;
@@ -604,9 +605,11 @@ valid_wild_card_simple(const char *data)
                /* found an escape, p points to the char after it, so skip
                 * that and move on.
                 */
-               if(tmpch == '\\')
+               if(tmpch == '\\' && *p)
                {
                        p++;
+                       if(++nonwild >= ConfigFileEntry.min_nonwildcard_simple)
+                               return 1;
                }
                else if(!IsMWildChar(tmpch))
                {
@@ -614,9 +617,12 @@ valid_wild_card_simple(const char *data)
                        if(++nonwild >= ConfigFileEntry.min_nonwildcard_simple)
                                return 1;
                }
+               else
+                       wild++;
        }
 
-       return 0;
+       /* strings without wilds are also ok */
+       return wild == 0;
 }
 
 time_t