diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1996-11-13 21:59:02 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1996-11-13 21:59:02 +0000 |
commit | 56911cb75d4110ea29279e58e3503ff7de02e7df (patch) | |
tree | 25a1c0d09b86b4e539e6da6ffb42d3886f17bd07 /rcfile_y.y | |
parent | 0f3e9e0c241c4152147d9be8b15ac367109c4146 (diff) | |
download | fetchmail-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.y | 22 |
1 files changed, 17 insertions, 5 deletions
@@ -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);} |