]> diplodocus.org Git - nmh/blobdiff - uip/mhstoresbr.c
Turns out those warnings for ali(1) actually happen when the prefix is
[nmh] / uip / mhstoresbr.c
index 78ceef52c2844a0103c77413370258882c8dfef3..3ca4c7c677c0706b26f19319de0cd170e10a9b91 100644 (file)
@@ -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;