From: Thibault Godouet Date: Wed, 26 Dec 2012 18:20:22 +0000 (+0000) Subject: Merge remote-tracking branch 'origin/master' X-Git-Tag: ver3_1_1~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c6ee20e7ded17030b8c0bb3ba4757c7c080541a0;p=thirdparty%2Ffcron.git Merge remote-tracking branch 'origin/master' Conflicts: fileconf.c --- c6ee20e7ded17030b8c0bb3ba4757c7c080541a0 diff --cc fileconf.c index 7197fb0,ced31d5..2b446ab --- a/fileconf.c +++ b/fileconf.c @@@ -496,58 -496,58 +496,58 @@@ read_opt(char *ptr, cl_t * cl return NULL; \ } - if ( *ptr == '!' ) - ptr++; + if (*ptr == '!') + ptr++; + + do { + i = 0; + bzero(opt_name, sizeof(opt_name)); - do { - i = 0; - bzero(opt_name, sizeof(opt_name)); + while (isalnum((int)*ptr) && i < sizeof(opt_name)) + opt_name[i++] = *ptr++; - while ( isalnum( (int) *ptr) && i < sizeof(opt_name)) - opt_name[i++] = *ptr++; - - i = 1; - in_brackets = 0; + i = 1; + in_brackets = 0; - if ( *ptr == '(' ) { - in_brackets = 1; - ptr++; + if (*ptr == '(') { + in_brackets = 1; + ptr++; - } - /* spaces are not allowed -- make sure there is no leading space. */ - if (isspace((int)*ptr)) { - Handle_err; + /* spaces are not allowed -- make sure there is no leading space. */ - if ( isspace( (int) *ptr) ) { ++ if (isspace((int)*ptr)) { ++ Handle_err; ++ } + } + + /* global options for a file */ + + if (strcmp(opt_name, "tzdiff") == 0) { + char negative = 0; + + if (!in_brackets) Handle_err; + if (*ptr == '-') { + negative = 1; + ptr++; } - } - - /* global options for a file */ - - if ( strcmp(opt_name, "tzdiff") == 0 ) { - char negative = 0; - - if ( ! in_brackets ) - Handle_err; - if ( *ptr == '-' ) { - negative = 1; - ptr++; - } - if ( (ptr = get_num(ptr, &i, 24, 0, NULL)) == NULL ) - Handle_err; - if ( negative ) - cl->cl_file->cf_tzdiff = (- i); - else - cl->cl_file->cf_tzdiff = i; - - if (debug_opt) - fprintf(stderr, " Opt : \"%s\" (-)%d\n", opt_name, i); - } - - /* options related to a line (or a set of lines) */ - - else if ( strcmp(opt_name, "timezone") == 0 ) { + if ((ptr = get_num(ptr, &i, 24, 0, NULL)) == NULL) + Handle_err; + if (negative) + cl->cl_file->cf_tzdiff = (-i); + else + cl->cl_file->cf_tzdiff = i; + + if (debug_opt) + fprintf(stderr, " Opt : \"%s\" (-)%d\n", opt_name, i); + } + + /* options related to a line (or a set of lines) */ + + else if (strcmp(opt_name, "timezone") == 0) { int len = -1; - if ( ! in_brackets ) { - Handle_err; + if (!in_brackets) { + Handle_err; } len = assign_option_string(&(cl->cl_tz), ptr);