From 4fd293e37328dc53283a3548ece1277f12272a6d Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sun, 16 Apr 2000 19:47:12 +0000 Subject: Fix brown-paper-bag bug. svn path=/trunk/; revision=2879 --- env.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'env.c') diff --git a/env.c b/env.c index 8911bc21..1adba642 100644 --- a/env.c +++ b/env.c @@ -97,12 +97,13 @@ void envquery(int argc, char **argv) */ rcfile = (char *)xmalloc(strlen(fmhome)+sizeof(RCFILE_NAME)+(fmhome==home)+1); /* avoid //.fetchmailrc */ - if (strcmp(fmhome, "/") != 0) { - strcat(rcfile, fmhome); - } else { - *rcfile = '\0'; - } - strcat(rcfile, "/"); + if (strcmp(fmhome, "/") != 0) + strcpy(rcfile, fmhome); + else + *rcfile = '\0'; + + if (rcfile[strlen(rcfile) - 1] != '/') + strcat(rcfile, "/"); if (fmhome==home) strcat(rcfile, "."); strcat(rcfile, RCFILE_NAME); -- cgit v1.2.3