X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/f3a97f2ee12563029514d15464b201397d1569df..8206fbf:/uip/mhstoresbr.c?ds=sidebyside diff --git a/uip/mhstoresbr.c b/uip/mhstoresbr.c index 78ceef52..3ca4c7c6 100644 --- a/uip/mhstoresbr.c +++ b/uip/mhstoresbr.c @@ -82,9 +82,6 @@ int part_ok (CT, int); int type_ok (CT, int); void flush_errors (void); -/* mhshowsbr.c */ -int show_content_aux (CT, int, int, char *, char *); - /* * prototypes */ @@ -569,13 +566,9 @@ store_content (CT ct, CT p, mhstoreinfo_t info) if ((cp = ct->c_storeproc) == NULL || *cp == '\0') { CI ci = &ct->c_ctinfo; - snprintf (buffer, sizeof(buffer), "%s-store-%s/%s", - invo_name, ci->ci_type, ci->ci_subtype); - if ((cp = context_find (buffer)) == NULL || *cp == '\0') { - snprintf (buffer, sizeof(buffer), "%s-store-%s", invo_name, ci->ci_type); - if ((cp = context_find (buffer)) == NULL || *cp == '\0') { - cp = ct->c_type == CT_MESSAGE ? "+" : "%m%P.%s"; - } + cp = context_find_by_type ("store", ci->ci_type, ci->ci_subtype); + if (cp == NULL) { + cp = ct->c_type == CT_MESSAGE ? "+" : "%m%P.%s"; } } @@ -623,7 +616,7 @@ store_content (CT ct, CT p, mhstoreinfo_t info) * content to standard input of a command and return. */ if (buffer[0] == '|' || buffer[0] == '!') - return show_content_aux (ct, 1, 0, buffer + 1, info->dir); + return show_content_aux (ct, 0, buffer + 1, info->dir, NULL); /* record the filename */ if ((ct->c_storage = clobber_check (add (buffer, NULL), info)) == @@ -790,7 +783,9 @@ losing: break; default: - fwrite (buffer, sizeof(*buffer), cc, fp); + if ((int) fwrite (buffer, sizeof(*buffer), cc, fp) < cc) { + advise ("output_content_file", "fwrite"); + } continue; } break;