aboutsummaryrefslogtreecommitdiffstats
path: root/env.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2000-04-16 19:47:12 +0000
committerEric S. Raymond <esr@thyrsus.com>2000-04-16 19:47:12 +0000
commit4fd293e37328dc53283a3548ece1277f12272a6d (patch)
tree43bf9641331939df5a4e44c4e302d75622a73ed4 /env.c
parent3f552680b4b9360a2c63357e3a6239025ba23415 (diff)
downloadfetchmail-4fd293e37328dc53283a3548ece1277f12272a6d.tar.gz
fetchmail-4fd293e37328dc53283a3548ece1277f12272a6d.tar.bz2
fetchmail-4fd293e37328dc53283a3548ece1277f12272a6d.zip
Fix brown-paper-bag bug.
svn path=/trunk/; revision=2879
Diffstat (limited to 'env.c')
-rw-r--r--env.c13
1 files changed, 7 insertions, 6 deletions
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);