Commit c8ae6507 c8ae650738984896d1893bb570868f717410444d by Sergey Poznyakoff

Minor changes

1 parent af202127
......@@ -220,7 +220,7 @@ SCM_DEFINE_PUBLIC (scm_mu_mailbox_open, "mu-mailbox-open", 2, 0, 0,
int status;
SCM ret;
SCM_ASSERT (scm_is_string (url), url, SCM_ARG1, FUNC_NAME);
SCM_ASSERT (scm_is_bool (url) || scm_is_string (url), url, SCM_ARG1, FUNC_NAME);
SCM_ASSERT (scm_is_string (mode), mode, SCM_ARG2, FUNC_NAME);
scm_dynwind_begin (0);
......@@ -247,8 +247,20 @@ SCM_DEFINE_PUBLIC (scm_mu_mailbox_open, "mu-mailbox-open", 2, 0, 0,
if (mode_bits & MU_STREAM_READ && mode_bits & MU_STREAM_WRITE)
mode_bits = (mode_bits & ~(MU_STREAM_READ | MU_STREAM_WRITE)) | MU_STREAM_RDWR;
mode_str = scm_to_locale_string (url);
scm_dynwind_free (mode_str);
if (scm_is_bool (url))
{
if (url == SCM_BOOL_F)
mode_str = NULL;
else
mu_scm_error (FUNC_NAME, EINVAL,
"value #t for URL is reserved for future use",
scm_list_1 (url));
}
else
{
mode_str = scm_to_locale_string (url);
scm_dynwind_free (mode_str);
}
status = mu_mailbox_create_default (&mbox, mode_str);
if (status)
......
......@@ -111,6 +111,7 @@ SCM_DEFINE_PUBLIC (scm_mu_register_format, "mu-register-format", 0, 0, 1,
{
int status;
SCM_VALIDATE_REST_ARGUMENT (rest);
if (scm_is_null (rest))
{
status = register_format (NULL);
......
......@@ -513,7 +513,7 @@ mail_send (int argc, char **argv)
mode = hp->mode;
if (mu_header_sget_value (env.header, hp->name, NULL) == 0)
mode = COMPOSE_REPLACE;
compose_header_set (&env, hp->name, hp->value, hp->mode);
compose_header_set (&env, hp->name, hp->value, mode);
}
mu_iterator_destroy (&itr);
}
......
......@@ -27,6 +27,7 @@ exec ${GUILE-guile} -l $0 -c "(apply $main (list (command-line)))" "$@"
(use-modules (ice-9 getopt-long)
(ice-9 rdelim)
(ice-9 eval-string)
(srfi srfi-1)
(mailutils mailutils))
......@@ -190,7 +191,7 @@ for any corresponding short options.
guimb-module)
(define-macro (bound? name)
`(and (module-defined? guimb-module ',name)
`(and (module-defined? (get-module) ',name)
(procedure? ,name)))
(define (guimb-parse-command-line cmdline)
......@@ -219,17 +220,12 @@ for any corresponding short options.
(if (not output-mailbox-mode)
(set! output-mailbox-mode (if (null? input-mailbox-names) "wr" "a")))
(cond
(user-name
(set! output-mailbox
(mu-mailbox-open
(if (string? user-name)
(string-append "%" user-name)
"")
output-mailbox-mode)))
(output-mailbox-name
(set! output-mailbox (mu-mailbox-open output-mailbox-name
output-mailbox-mode))))
(if (and (not output-mailbox-name) user-name)
(set! output-mailbox-name (if (string? user-name)
(string-append "%" user-name)
#f)))
(set! output-mailbox (mu-mailbox-open output-mailbox-name
output-mailbox-mode))
; (write output-mailbox)(newline)
(if source-file-name
......