commit 4b31522fdf67e5d8f6e34540e62145d570032095
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Sun Feb 15 12:48:46 2015 +0100

    complain about excess values supplied to options

 src/config.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/config.c b/src/config.c
index fb9dc5f..1c181ce 100644
--- a/src/config.c
+++ b/src/config.c
@@ -236,8 +236,13 @@ getopt_helper( conffile_t *cfile, int *cops, 
channel_conf_t *conf )
 int
 getcline( conffile_t *cfile )
 {
+       char *arg;
        int comment;
 
+       if (cfile->rest && (arg = get_arg( cfile, ARG_OPTIONAL, 0 ))) {
+               error( "%s:%d: excess token '%s'\n", cfile->file, cfile->line, 
arg );
+               cfile->err = 1;
+       }
        while (fgets( cfile->buf, cfile->bufl, cfile->fp )) {
                cfile->line++;
                cfile->rest = cfile->buf;
@@ -337,6 +342,7 @@ load_config( const char *where, int pseudo )
        cfile.bufl = sizeof(buf) - 1;
        cfile.line = 0;
        cfile.err = 0;
+       cfile.rest = 0;
 
        gcops = 0;
        global_conf.expire_unread = -1;

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel

Reply via email to