🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
1 messages
1 total messages Started by Thomas Schultz Mon, 19 Jul 1999 00:00
[slrn] Bug: set_header_score() and header flags
#49967
Author: Thomas Schultz
Date: Mon, 19 Jul 1999 00:00
74 lines
2843 bytes
Hi,

I just discovered a behaviour in slrn that I consider a bug:

set_header_score(get_variable_value("min_high_score"));

After using this command, the current article has the
HEADER_HIGH_SCORE flag set. Good. But when I use

set_header_score(get_variable_value("min_high_score")-1);

it does not lose it. A similar problem occurs here:

set_header_score(get_variable_value("max_low_score")-1);

sets the HEADER_LOW_SCORE flag. Again, when using

set_header_score(get_variable_value("max_low_score"));

the article does not lose it. I believe that this should be changed.
Here is a patch which does exactly this (it really only affects a few
lines; the reason why it looks that long is that the indentation of a
couple of lines has changed):

diff -ur slrn-0.9.5.7.orig/src/art.c slrn-0.9.5.7/src/art.c
--- slrn-0.9.5.7.orig/src/art.c	Thu Jul 15 23:19:28 1999
+++ slrn-0.9.5.7/src/art.c	Mon Jul 19 03:01:40 1999
@@ -5438,22 +5438,27 @@
 	h->flags |= HEADER_HIGH_SCORE;
 	Number_High_Scored++;
      }
-   else if (score < Slrn_Low_Score_Max)
+   else
      {
-	if ((score <= Slrn_Kill_Score_Max) && apply_kill)
+	h->flags &= ~(HEADER_HIGH_SCORE);
+		
+	if (score < Slrn_Low_Score_Max)
 	  {
-	     int number = h->number;
-	     free_header (h);
-	     add_to_kill_list (number);
-	     return NULL;
+	     if ((score <= Slrn_Kill_Score_Max) && apply_kill)
+	       {
+		  int number = h->number;
+		  free_header (h);
+		  add_to_kill_list (number);
+		  return NULL;
+	       }
+	     
+	     h->flags |= (HEADER_READ | HEADER_LOW_SCORE);
+	     Number_Low_Scored++;
+	     /* The next line should be made configurable */
+	     kill_cross_references (h);
 	  }
-	
-	h->flags &= ~(HEADER_HIGH_SCORE);
-	h->flags |= (HEADER_READ | HEADER_LOW_SCORE);
-	Number_Low_Scored++;
-	/* The next line should be made configurable */
-	kill_cross_references (h);
-     }
+	else h->flags &= ~(HEADER_LOW_SCORE);
+     }   
 #if SLRN_HAS_SORT_BY_SCORE
    h->thread_score = h->score = score;
 #endif

-- 
Kind regards,
    Thomas Schultz

Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads