Commit ebf199fb ebf199fb6d603c14605ed8f1ac7c03933528d601 by Sergey Poznyakoff

handle #f when printing mailbox object

1 parent 49f791dd
...@@ -58,18 +58,26 @@ mu_scm_mailbox_print (SCM mailbox_smob, SCM port, scm_print_state * pstate) ...@@ -58,18 +58,26 @@ mu_scm_mailbox_print (SCM mailbox_smob, SCM port, scm_print_state * pstate)
58 58
59 scm_puts ("#<mailbox ", port); 59 scm_puts ("#<mailbox ", port);
60 60
61 p = url_to_string (url); 61 if (mailbox_smob == SCM_BOOL_F)
62 if (p)
63 { 62 {
64 char buf[64]; 63 /* mu_mailbox.* functions may return #f */
65 64 scm_puts ("#f", port);
66 scm_puts (p, port);
67
68 snprintf (buf, sizeof (buf), " (%d)", count);
69 scm_puts (buf, port);
70 } 65 }
71 else 66 else
72 scm_puts ("uninitialized", port); 67 {
68 p = url_to_string (url);
69 if (p)
70 {
71 char buf[64];
72
73 scm_puts (p, port);
74
75 snprintf (buf, sizeof (buf), " (%d)", count);
76 scm_puts (buf, port);
77 }
78 else
79 scm_puts ("uninitialized", port);
80 }
73 scm_puts (">", port); 81 scm_puts (">", port);
74 82
75 return 1; 83 return 1;
......