aboutsummaryrefslogtreecommitdiffstats
path: root/fetchmail.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2000-04-16 07:29:42 +0000
committerEric S. Raymond <esr@thyrsus.com>2000-04-16 07:29:42 +0000
commit9445ac66eef95c5d6274c8ca15a8b48c0c015b31 (patch)
tree6172312155eff03286fb1f00f9665b8f361a3c59 /fetchmail.c
parentb9923882dd40ed3bc139ae0cf27bdc7b2d8ff560 (diff)
downloadfetchmail-9445ac66eef95c5d6274c8ca15a8b48c0c015b31.tar.gz
fetchmail-9445ac66eef95c5d6274c8ca15a8b48c0c015b31.tar.bz2
fetchmail-9445ac66eef95c5d6274c8ca15a8b48c0c015b31.zip
FETCHMAILHOME
svn path=/trunk/; revision=2875
Diffstat (limited to 'fetchmail.c')
-rw-r--r--fetchmail.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/fetchmail.c b/fetchmail.c
index f7428211..75f2bf14 100644
--- a/fetchmail.c
+++ b/fetchmail.c
@@ -69,6 +69,7 @@ flag check_only; /* if --probe was set */
flag versioninfo; /* emit only version info */
char *user; /* the name of the invoking user */
char *home; /* invoking user's home directory */
+char *fmhome; /* fetchmail's home directory */
char *program_name; /* the name to prefix error messages with */
flag configdump; /* dump control blocks for configurator */
const char *fetchmailhost; /* either `localhost' or the host's FQDN */
@@ -157,8 +158,8 @@ int main(int argc, char **argv)
}
#define IDFILE_NAME ".fetchids"
- run.idfile = (char *) xmalloc(strlen(home)+sizeof(IDFILE_NAME)+1);
- strcpy(run.idfile, home);
+ run.idfile = (char *) xmalloc(strlen(fmhome)+sizeof(IDFILE_NAME)+1);
+ strcpy(run.idfile, fmhome);
strcat(run.idfile, "/");
strcat(run.idfile, IDFILE_NAME);
@@ -261,9 +262,11 @@ int main(int argc, char **argv)
sizeof(PID_DIR) + sizeof(FETCHMAIL_PIDFILE));
sprintf(tmpbuf, "%s/%s", PID_DIR, FETCHMAIL_PIDFILE);
} else {
- xalloca(tmpbuf, char *, strlen(home) + sizeof(FETCHMAIL_PIDFILE) + 2);
- strcpy(tmpbuf, home);
- strcat(tmpbuf, "/.");
+ xalloca(tmpbuf, char *, strlen(fmhome) + sizeof(FETCHMAIL_PIDFILE) + 2);
+ strcpy(tmpbuf, fmhome);
+ strcat(tmpbuf, "/");
+ if (fmhome == home)
+ strcat(tmpbuf, ".");
strcat(tmpbuf, FETCHMAIL_PIDFILE);
}
#undef FETCHMAIL_PIDFILE
@@ -285,7 +288,7 @@ int main(int argc, char **argv)
#define NETRC_FILE ".netrc"
/* parse the ~/.netrc file (if present) for future password lookups. */
- xalloca(netrc_file, char *, strlen (home) + sizeof(NETRC_FILE) + 1);
+ xalloca(netrc_file, char *, strlen(home) + sizeof(NETRC_FILE) + 1);
strcpy (netrc_file, home);
strcat (netrc_file, "/");
strcat (netrc_file, NETRC_FILE);