handle #f when printing mailbox object
Showing
1 changed file
with
17 additions
and
9 deletions
... | @@ -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; | ... | ... |
-
Please register or sign in to post a comment