From 56911cb75d4110ea29279e58e3503ff7de02e7df Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Wed, 13 Nov 1996 21:59:02 +0000 Subject: Require userspec lists to be nonempty. svn path=/trunk/; revision=539 --- rcfile_y.y | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'rcfile_y.y') 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 */ -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);} -- cgit v1.2.3