}
%token SHOW_NEWSGROUPS
-%token SHOW_DATE SHOW_FROM SHOW_FULLNAME SHOW_FIRST_NAME
+%token SHOW_DATE SHOW_FROM SHOW_FULLNAME SHOW_FIRST_NAME SHOW_LAST_NAME
%token SHOW_SENDER_INITIAL SHOW_SUBJECT SHOW_TO SHOW_MESSAGEID
%token SHOW_PERCENT SHOW_CC SHOW_REFERENCES SHOW_MESSAGE
%token SHOW_QUOTED_MESSAGE SHOW_BACKSLASH SHOW_TAB
}
}
}
+ | SHOW_LAST_NAME
+ {
+ /* This probably won't work together very well with Middle
+ names and the like - thth */
+ if (msginfo->fromname) {
+ gchar *p;
+ gchar *str;
+
+ str = alloca(strlen(msginfo->fromname) + 1);
+ if (str != NULL) {
+ strcpy(str, msginfo->fromname);
+ p = str;
+ while (*p && !isspace(*p)) p++;
+ if (*p) {
+ /* We found a space. Get first none-space char and
+ insert rest of string from there. */
+ while (*p && isspace(*p)) p++;
+ if (*p) {
+ INSERT(p);
+ } else {
+ /* If there is no none-space char, just insert
+ whole fromname. */
+ INSERT(str);
+ }
+ } else {
+ /* If there is no space, just insert whole fromname. */
+ INSERT(str);
+ }
+ }
+ }
+ }
| SHOW_SENDER_INITIAL
{
#define MAX_SENDER_INITIAL 20
FILE *file;
char buffer[256];
- if(file = fopen($3, "r")) {
+ if(file = fopen($3, "rb")) {
while(fgets(buffer, sizeof(buffer), file)) {
INSERT(buffer);
}