X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/1e0b1d40a6285c532b722f4584fa7ddde220deff..1fd76d60f580a4f33f1ad58e9314c12562fca116:/uip/repl.c?ds=inline diff --git a/uip/repl.c b/uip/repl.c index ebe72ff2..15aa0a3a 100644 --- a/uip/repl.c +++ b/uip/repl.c @@ -225,7 +225,8 @@ main (int argc, char **argv) nwhat = 0; continue; case BILDSW: - buildsw++; /* fall... */ + buildsw++; + /* FALLTHRU */ case NWHATSW: nwhat++; continue; @@ -239,8 +240,7 @@ main (int argc, char **argv) if (fcc) fcc = add (", ", fcc); fcc = add (cp, fcc); - if (dp) - free (dp); + mh_xfree(dp); continue; case FILESW: @@ -354,7 +354,7 @@ main (int argc, char **argv) if (ccme == -1) ccme = groupreply; - cwd = getcpy (pwd ()); + cwd = mh_xstrdup(pwd ()); if (!context_find ("path")) free (path ("./", TFOLDER)); @@ -370,7 +370,8 @@ try_it_again: if (!buildsw && stat (drft, &st) != NOTOK) { printf ("Draft \"%s\" exists (%ld bytes).", drft, (long) st.st_size); for (i = LISTDSW; i != YESW;) { - if (!(argp = getans ("\nDisposition? ", isdf ? aqrnl : aqrl))) + if (!(argp = read_switch_multiword ("\nDisposition? ", + isdf ? aqrnl : aqrl))) done (1); switch (i = smatch (*argp, isdf ? aqrnl : aqrl)) { case NOSW: @@ -434,7 +435,7 @@ try_it_again: context_save (); /* save the context file */ } - msg = file ? file : getcpy (m_name (mp->lowsel)); + msg = file ? file : mh_xstrdup(m_name (mp->lowsel)); if ((in = fopen (msg, "r")) == NULL) adios (msg, "unable to open"); @@ -452,14 +453,16 @@ try_it_again: fclose (in); { - char *filename = concat (mp->foldpath, "/", msg, NULL); + char *filename = file ? file : concat (mp->foldpath, "/", msg, NULL); for (n = 0; n < svector_size (convert_types); ++n) { add_convert_header (svector_at (convert_types, n), svector_at (convert_args, n), filename, drft); } - free (filename); + if (! file) { + free (filename); + } } if (nwhat)