Use execprog() instead of system() ... partly transition
[mmh] / uip / repl.c
index 9c9e5ce..e5fbc0f 100644 (file)
@@ -573,11 +573,11 @@ finished:
                /* add an attachment header */
                char buffer[BUFSIZ];
 
-               snprintf(buffer, sizeof buffer, "anno -append -nodate '%s' "
-                               "-comp '%s' -text '+%s %s'",
-                               drft,
-                               attach_hdr, mp->foldpath, m_name(mp->lowsel));
-               if (system(buffer) != 0) {
+               snprintf(buffer, sizeof buffer, "+%s %s",
+                               mp->foldpath, m_name(mp->lowsel));
+               if (execprogl("anno", "anno", "-append", "-nodate",
+                               drft, "-comp", attach_hdr, "-text", buffer,
+                               (char *)NULL) != 0) {
                        advise(NULL, "unable to add attachment header");
                }
        }