X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;f=selector.c;h=ddddb112f95f0f6f596365354154950388401b80;hb=5f6df6ed91c745f06cdaec8983a7b1485994da39;hp=effd0140b760a4c8a0048e9f1cfbe8dec1e9e32b;hpb=3098ac58abc15df41eeb1f79e7529016685c74e2;p=selector.git diff --git a/selector.c b/selector.c index effd014..ddddb11 100644 --- a/selector.c +++ b/selector.c @@ -3,7 +3,7 @@ * selector is a simple command line utility for selection of strings * with a dynamic pattern-matching. * - * Copyright (c) 2009, 2010, 2011 Francois Fleuret + * Copyright (c) 2009, 2010, 2011, 2012 Francois Fleuret * Written by Francois Fleuret * * This file is part of selector. @@ -45,7 +45,7 @@ #include #include -#define VERSION "1.1.5" +#define VERSION "1.1.6" #define BUFFER_SIZE 4096 @@ -320,8 +320,9 @@ struct matcher { }; /* Routine to add an interval to a sorted list of intervals - extermities. Returns the number of extremities. This is an effing - nightmare */ + extremities. Returns the resulting number of extremities. + + This routine is an effing nightmare */ int add_interval(int n, int *switches, int start, int end) { int f, g, k; @@ -334,8 +335,8 @@ int add_interval(int n, int *switches, int start, int end) { while(g < n && switches[g] <= end) { g++; } if(f == n) { - /* switches[n] start end */ - /* XXXXXXXXXX| */ + /* switches[n-1] start end */ + /* XXXXXXXXXXXX| */ switches[f] = start; switches[f+1] = end; return n + 2;