]> Pileus Git - ~andy/fetchmail/commitdiff
Added `logfile' keyword to rc syntax.
authorEric S. Raymond <esr@thyrsus.com>
Wed, 27 Nov 1996 14:51:23 +0000 (14:51 -0000)
committerEric S. Raymond <esr@thyrsus.com>
Wed, 27 Nov 1996 14:51:23 +0000 (14:51 -0000)
svn path=/trunk/; revision=571

NEWS
fetchmail.c
fetchmail.h
fetchmail.man
options.c
rcfile_l.l
rcfile_y.y
sample.rcfile

diff --git a/NEWS b/NEWS
index 06134319422bda5acaa48aae58c782b7ba5f2575..045cabc0ce16786fa0be1333b259f0e133b41815 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,7 @@ pl 2.0.1 ():
   aka list so no potential alias has to be DNS-checked more than once.
 * Try to use envelope From.  If that fails, fall back on calling-user.
 * Added FAQ file
+* Added `logfile' keyword to rc syntax.
 
 fetchmail-2.0 (Mon Nov 18 00:32:17 EST 1996):
 
index c5883ffc150827484d21c74075aa482498b5498c..0a464906a8851d159b560f6ae336289fbccdc061 100644 (file)
@@ -49,6 +49,7 @@ char *logfile;                /* log file for daemon mode */
 int quitmode;          /* if --quit was set */
 int check_only;                /* if --probe was set */
 int cmd_batchlimit;    /* if --batchlimit was set */
+char *cmd_logfile;     /* if --logfile was set */
 
 /* miscellaneous global controls */
 char *rcfile;          /* path name of rc file */
@@ -594,6 +595,10 @@ static int load_params(int argc, char **argv, int optind)
     if (cmd_batchlimit > -1)
        batchlimit = cmd_batchlimit;
 
+    /* if cmd_logfile was explicitly set, use it to override logfile */
+    if (cmd_logfile)
+       logfile = cmd_logfile;
+
     return(implicitmode);
 }
 
index 3765f6f31067e4995d934a2410f2e979681910ce..451b3234affcc091367fd41b372d3124d01a1438 100644 (file)
@@ -142,6 +142,7 @@ extern char *logfile;               /* log file for daemon mode */
 extern int quitmode;           /* if --quit was set */
 extern int check_only;         /* if --check was set */
 extern int cmd_batchlimit;     /* if --batchlimit was set */
+extern char *cmd_logfile;      /* if --logfile was set */
 
 /* these get computed */
 extern int batchlimit;         /* if --batchlimit was set */
index afe2240e3d17b20adc6734f4374a1a4662d33802..ba259fcae67175150d048d87755883cab6809db2 100644 (file)
@@ -519,10 +519,11 @@ or reverse it by saying `user esr here is eric there'
 .PP
 For backward compatibility, the word `server' is a syninym for `poll'.
 .PP
-There is currently only one valid global option statement; it is 
+There are currently two valid global option statements; 
 \&`set batchlimit = ' followed by a number and sets the same global
-specified by the --batchlimit option.  (The command line option
-can override this.)
+specified by the --batchlimit option, and `set logfile = ' followed 
+by a string sets the same global specified by --logfile.  In both
+cases, a command-line option will override.
 .PP
 Basic format is:
 
index 4f1cd937a15294d9f3343982d9bb7f7630ac3c49..88af3799c7f9a944585bbcb1d32ab29ca292a8e9 100644 (file)
--- a/options.c
+++ b/options.c
@@ -141,7 +141,7 @@ struct query *ctl;  /* option record to be initialized */
            break;
        case 'L':
        case LA_LOGFILE:
-           logfile = optarg;
+           cmd_logfile = optarg;
            break;
        case 'f':
        case LA_RCFILE:
index 250b20c9c26520bc7f959d4eff33ba85f7341f3d..0f6d43d4d3fb56b500fa0e6b4f84803e01d28eeb 100644 (file)
@@ -21,6 +21,7 @@ int prc_lineno = 1;
 
 set            { return SET; }
 batchlimit     { return BATCHLIMIT; }
+logfile                { return LOGFILE; }
 defaults       { return DEFAULTS; }
 server                 { return POLL; }
 poll           { return POLL; }
index d22efa44fb8109910d145b92491898fd28aeba7e..010568b27cbf99297acdca13a92c2f17c018de8b 100644 (file)
@@ -43,7 +43,7 @@ static void prc_reset();
 
 %token DEFAULTS POLL SKIP AKA PROTOCOL AUTHENTICATE TIMEOUT KPOP KERBEROS
 %token USERNAME PASSWORD FOLDER SMTPHOST MDA IS HERE THERE TO MAP LIMIT
-%token SET BATCHLIMIT 
+%token SET BATCHLIMIT LOGFILE
 %token <proto> PROTO
 %token <sval>  STRING
 %token <number> NUMBER
@@ -65,6 +65,7 @@ statement_list        : statement
 
 /* future global options should also have the form SET <name> <value> */
 statement      : SET BATCHLIMIT MAP NUMBER     {batchlimit = $4;}
+               | SET LOGFILE STRING            {logfile = xstrdup($3);}
 
 /* 
  * The way the next two productions are written depends on the fact that
index 4f41c9dee15071df1d2e61301370d7e279fb15c4..453ea54dd378a8b169d9b99fd415caf549303792 100644 (file)
@@ -56,6 +56,7 @@
 # Legal global option statements are
 #
 #   set batchlimit =           -- must be followed by a number
+#   set logfile =              -- must be followed by a string
 #
 # The noise keywords `and', `with', `has', `wants', and `options' are ignored
 # anywhere in an entry; they can be used to make it resemble English.  The