diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2000-04-16 19:47:12 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2000-04-16 19:47:12 +0000 |
commit | 4fd293e37328dc53283a3548ece1277f12272a6d (patch) | |
tree | 43bf9641331939df5a4e44c4e302d75622a73ed4 /env.c | |
parent | 3f552680b4b9360a2c63357e3a6239025ba23415 (diff) | |
download | fetchmail-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.c | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -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); |