Commit 31fcf857 31fcf857134ba4ccd32d68b84064b5b86546894a by Jakob Kaivo

Added 'F'/'f' to test mbox_get_header()

1 parent 100fe99c
...@@ -2,4 +2,5 @@ CPPFLAGS = -I$(top_srcdir)/libmailbox ...@@ -2,4 +2,5 @@ CPPFLAGS = -I$(top_srcdir)/libmailbox
2 2
3 bin_PROGRAMS = mail 3 bin_PROGRAMS = mail
4 4
5 mail_DEPENDENCIES = ../libmailbox/libmailbox.la
5 mail_LDADD = ../libmailbox/libmailbox.la 6 mail_LDADD = ../libmailbox/libmailbox.la
......
...@@ -46,7 +46,7 @@ main (int argc, char **argv) ...@@ -46,7 +46,7 @@ main (int argc, char **argv)
46 fgets (bar, 80, stdin); 46 fgets (bar, 80, stdin);
47 c = bar[0]; 47 c = bar[0];
48 if (c == 'd' || c == 'D' || c == 'b' || c == 'B' || c == 'h' || 48 if (c == 'd' || c == 'D' || c == 'b' || c == 'B' || c == 'h' ||
49 c == 'H' || c == 'r' || c == 'R') 49 c == 'H' || c == 'r' || c == 'R' || c == 'f' || c == 'F')
50 { 50 {
51 printf ("# "); 51 printf ("# ");
52 fgets (bar, 80, stdin); 52 fgets (bar, 80, stdin);
...@@ -58,6 +58,12 @@ main (int argc, char **argv) ...@@ -58,6 +58,12 @@ main (int argc, char **argv)
58 mbox_close (mbox); 58 mbox_close (mbox);
59 return 0; 59 return 0;
60 break; 60 break;
61 case 'f':
62 case 'F':
63 foo = mbox_header_line (mbox, atoi (bar) - 1, "from");
64 printf ("%s\n", foo);
65 free (foo);
66 break;
61 case 'r': 67 case 'r':
62 case 'R': 68 case 'R':
63 foo = mbox_get_header (mbox, atoi (bar) - 1); 69 foo = mbox_get_header (mbox, atoi (bar) - 1);
......