summaryrefslogtreecommitdiff
blob: 4888cbdd91ee9bc8ba47666341e75ee621de1a78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
--- slrn-0.9.8.0/src/ranges.c	2003-08-02 01:19:39.000000000 +0200
+++ slrn/src/ranges.c	2003-09-02 14:45:34.000000000 +0200
@@ -264,13 +264,17 @@
    do
      {
 	/* skip ranges that don't intersect at all */
-	if (b != NULL)
-	  while ((a != NULL) && (a->max < b->min))
-	    a = a->next;
-	
-	if (a != NULL)
-	  while ((b != NULL) && (b->max < a->min))
-	    b = b->next;
+	do
+	  {
+	     if (b != NULL)
+	       while ((a != NULL) && (a->max < b->min))
+		 a = a->next;
+	     
+	     if (a != NULL)
+	       while ((b != NULL) && (b->max < a->min))
+		 b = b->next;
+	  }
+	while ((a!=NULL) && (b!=NULL) && (a->max < b->min));
 	
 	/* append a range containing the next intersection */
 	if ((a!=NULL) && (b!=NULL))