aboutsummaryrefslogtreecommitdiffstats
path: root/rcfile_y.y
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1996-11-13 21:59:02 +0000
committerEric S. Raymond <esr@thyrsus.com>1996-11-13 21:59:02 +0000
commit56911cb75d4110ea29279e58e3503ff7de02e7df (patch)
tree25a1c0d09b86b4e539e6da6ffb42d3886f17bd07 /rcfile_y.y
parent0f3e9e0c241c4152147d9be8b15ac367109c4146 (diff)
downloadfetchmail-56911cb75d4110ea29279e58e3503ff7de02e7df.tar.gz
fetchmail-56911cb75d4110ea29279e58e3503ff7de02e7df.tar.bz2
fetchmail-56911cb75d4110ea29279e58e3503ff7de02e7df.zip
Require userspec lists to be nonempty.
svn path=/trunk/; revision=539
Diffstat (limited to 'rcfile_y.y')
-rw-r--r--rcfile_y.y22
1 files changed, 17 insertions, 5 deletions
diff --git a/rcfile_y.y b/rcfile_y.y
index 22fbd8db..af6398fb 100644
--- a/rcfile_y.y
+++ b/rcfile_y.y
@@ -64,8 +64,16 @@ statement_list : statement
;
/* future global options should also have the form SET <name> <value> */
-statement : define_server serverspecs userspecs
- | SET BATCHLIMIT MAP NUMBER {batchlimit = $4;}
+statement : SET BATCHLIMIT MAP NUMBER {batchlimit = $4;}
+
+/*
+ * The way the next two productions are written depends on the fact that
+ * userspecs cannot be empty. It's a kluge to deal with files that sset
+ * up a load of defaults and then have poll statements following with no
+ * user options at all.
+ */
+ | define_server serverspecs {prc_register(); prc_reset();}
+ | define_server serverspecs userspecs
;
define_server : POLL STRING {strcpy(current.servername, $2);}
@@ -90,9 +98,12 @@ serv_option : PROTOCOL PROTO {current.protocol = $2;}
| TIMEOUT NUMBER {current.timeout = $2;}
;
-/* the first and only the first user spec may omit the USERNAME part */
-userspecs : /* EMPTY */
- | user1opts {prc_register(); prc_reset();}
+/*
+ * The first and only the first user spec may omit the USERNAME part.
+ * This is a backward-compatibility kluge to allow old popclient files
+ * to keep working.
+ */
+userspecs : user1opts {prc_register(); prc_reset();}
| user1opts explicits {prc_register(); prc_reset();}
| explicits
;
@@ -131,6 +142,7 @@ user_option : TO mapping_list HERE
| TO mapping_list
| IS mapping_list HERE
| IS mapping_list
+
| IS STRING THERE {strcpy(current.remotename, $2);}
| PASSWORD STRING {strcpy(current.password, $2);}
| FOLDER STRING {strcpy(current.mailbox, $2);}