aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1996-07-03 02:54:50 +0000
committerEric S. Raymond <esr@thyrsus.com>1996-07-03 02:54:50 +0000
commit9aafb07f141bbd1cae1395e34fe3d064918c6712 (patch)
treeab8d0347fc4486ad4d84cd48182f56f7ac3f7a08
parent1a9213a862e2b7c2b3e918d7700a82f014004b08 (diff)
downloadfetchmail-9aafb07f141bbd1cae1395e34fe3d064918c6712.tar.gz
fetchmail-9aafb07f141bbd1cae1395e34fe3d064918c6712.tar.bz2
fetchmail-9aafb07f141bbd1cae1395e34fe3d064918c6712.zip
poprcfile is now a single global.
svn path=/trunk/; revision=26
-rw-r--r--fetchmail.c8
-rw-r--r--fetchmail.h5
-rw-r--r--options.c12
3 files changed, 12 insertions, 13 deletions
diff --git a/fetchmail.c b/fetchmail.c
index dc9d39cb..8918fe64 100644
--- a/fetchmail.c
+++ b/fetchmail.c
@@ -64,6 +64,8 @@ int poll_interval; /* polling interval for daemon mode */
char *logfile; /* logfile to ship progress reports to */
int quitmode; /* if -quit was set */
+char *poprcfile; /* path name of rc file */
+
/* args for the MDA, parsed out in the usual fashion by parseMDAargs() */
char *mda_argv [32];
@@ -105,7 +107,7 @@ char **argv;
if (cmd_opts.versioninfo)
showversioninfo();
- if (prc_parse_file(prc_getpathname(&cmd_opts,&def_opts)) != 0)
+ if (prc_parse_file(poprcfile) != 0)
exit(PS_SYNTAX);
if (optind >= argc)
@@ -129,14 +131,14 @@ char **argv;
/* perhaps we just want to check options? */
if (cmd_opts.versioninfo) {
- printf("Taking options from command line and %s\n", prc_pathname);
+ printf("Taking options from command line and %s\n", poprcfile);
for (hostp = hostlist; hostp; hostp = hostp->next) {
printf("Options for host %s:\n", hostp->servername);
dump_options(&hostp->options);
}
if (hostlist == NULL)
(void) printf("No mailservers set up -- perhaps %s is missing?\n",
- prc_pathname);
+ poprcfile);
exit(0);
}
else if (hostlist == NULL) {
diff --git a/fetchmail.h b/fetchmail.h
index 0a97272c..1f8028f2 100644
--- a/fetchmail.h
+++ b/fetchmail.h
@@ -55,7 +55,6 @@ struct optrec {
int fetchall;
int flush;
int output;
- char *poprcfile;
char localname [USERNAMELEN];
char remotename [USERNAMELEN];
char password [PASSWORDLEN];
@@ -92,7 +91,7 @@ extern int poll_interval; /* poll interval in seconds */
extern char *logfile; /* log file for daemon mode */
extern int quitmode; /* if --quit was set */
-extern char *prc_pathname; /* path name of rc file */
+extern char *poprcfile; /* path name of rc file */
#ifdef HAVE_PROTOTYPES
@@ -108,7 +107,6 @@ int closeuserfolder (int fd);
int openmailpipe (struct optrec *options);
int closemailpipe (int fd);
char *MD5Digest (char *);
-char *prc_getpathname (struct optrec *cmd_opts, struct optrec *def_opts);
void reply_hack(char *buf, const char *host);
void append_server_names(int *pargc, char **argv);
int daemonize(const char *logfile, void (*)(void));
@@ -117,7 +115,6 @@ int daemonize(const char *logfile, void (*)(void));
char *getnextserver();
char *MD5Digest ();
-char *prc_getpathname();
void reply_hack ();
void append_server_names ();
int daemonize ();
diff --git a/options.c b/options.c
index ef6bdf37..7b9e8c87 100644
--- a/options.c
+++ b/options.c
@@ -184,8 +184,8 @@ struct optrec *options;
break;
case 'f':
case LA_POPRC:
- options->poprcfile = (char *) xmalloc(strlen(optarg)+1);
- strcpy(options->poprcfile,optarg);
+ poprcfile = (char *) xmalloc(strlen(optarg)+1);
+ strcpy(poprcfile,optarg);
break;
case 'u':
case LA_USERNAME:
@@ -309,12 +309,12 @@ struct optrec *options;
(void) sprintf(options->mda, DEF_MDA, options->localname);
- options->poprcfile =
+ poprcfile =
(char *) xmalloc(strlen(pw->pw_dir)+strlen(POPRC_NAME)+2);
- strcpy(options->poprcfile, pw->pw_dir);
- strcat(options->poprcfile, "/");
- strcat(options->poprcfile, POPRC_NAME);
+ strcpy(poprcfile, pw->pw_dir);
+ strcat(poprcfile, "/");
+ strcat(poprcfile, POPRC_NAME);
outlevel = O_NORMAL;