if ((drft == NULL && (drft = getenv ("mhdraft")) == NULL) || *drft == 0)
drft = getcpy (m_draft (dfolder, dmsg, 1, &isdf));
- msgnam = (cp = getenv ("mhaltmsg")) && *cp ? getcpy (cp) : NULL;
+ msgnam = (cp = getenv ("mhaltmsg")) && *cp ? mh_xstrdup(cp) : NULL;
if ((cp = getenv ("mhatfile")) && *cp)
atfile = atoi(cp);
if (fgets(cwd, sizeof (cwd), f) == NULL) {
advise (buf, "fgets");
}
-
- if (strchr(cwd, '\n') != (char *)0)
- *strchr(cwd, '\n') = '\0';
-
+ TrimSuffixC(cwd, '\n');
pclose(f);
}
else {
while (fgets(shell, sizeof (shell), f) != (char *)0) {
char *ctype;
- *(strchr(shell, '\n')) = '\0';
+ TrimSuffixC(shell, '\n');
if (*shell == '/') {
strncpy(file, shell, sizeof(file));
writelscmd(buf, sizeof(buf), "-d --", argp);
if ((f = popen_in_dir(cwd, buf, "r")) != (FILE *)0) {
while (fgets(shell, sizeof (shell), f) != (char *)0) {
- *(strchr(shell, '\n')) = '\0';
+ TrimSuffixC(shell, '\n');
annotate(drft, ATTACH_FIELD, shell, 1, 0, 0, 1);
}
pclose(f);
X("nodraftfolder", 0, SNDRFSW) \
X("sasl", SASLminc(4), SASLSW) \
X("nosasl", SASLminc(6), NOSASLSW) \
- X("saslmaxssf", SASLminc(10), SASLMXSSFSW) \
X("saslmech", SASLminc(5), SASLMECHSW) \
X("authservice", SASLminc(0), AUTHSERVICESW) \
X("user username", SASLminc(4), USERSW) \
case WIDTHSW:
case CLIESW:
case SERVSW:
- case SASLMXSSFSW:
case USERSW:
case PORTSW:
case MTSSM:
if ((cp = context_find ("Aliasfile"))) {
char **ap, *dp;
- dp = getcpy (cp);
+ dp = mh_xstrdup(cp);
for (ap = brkstring (dp, " ", "\n"); ap && *ap; ap++) {
vec[vecp++] = "-alias";
vec[vecp++] = *ap;
adios(NULL, "unable to create temporary file in %s",
get_temp_dir());
}
- distfile = getcpy (cp);
+ distfile = mh_xstrdup(cp);
(void) m_unlink(distfile);
if (link (altmsg, distfile) == NOTOK)
adios (distfile, "unable to link %s to", altmsg);