Added subject line cleaner

This commit is contained in:
Michiel Broek
2005-08-10 15:32:42 +00:00
parent abdbbc862e
commit ccfd32e420
11 changed files with 150 additions and 106 deletions

View File

@@ -2345,7 +2345,8 @@ unsigned char mbse_Readkey(void); /* Read a translated key */
*/
char *padleft(char *str, int size, char pad);
char *tl(char *str);
void Striplf(char *String);
void Striplf(char *);
void mbse_CleanSubject(char *);
void tlf(char *str);
char *tu(char *str);
char *tlcap(char *);

View File

@@ -83,6 +83,35 @@ void Striplf(char *String)
void mbse_CleanSubject(char *String)
{
int i, fixed = FALSE;
i = strlen(String) -1;
while ((isspace(String[i])) && i) {
String[i] = '\0';
i--;
fixed = TRUE;
}
if ((strncasecmp(String, "Re: ", 4) == 0) && (strncmp(String, "Re: ", 4))) {
/*
* Fix Re:
*/
String[0] = 'R';
String[1] = 'e';
String[2] = ':';
String[3] = ' ';
fixed = TRUE;
}
if (fixed)
Syslog('m', "Fixed subj: \"%s\"", printable(String, 0));
}
/*
* Converts first letter to UpperCase
*/