]> granicus.if.org Git - fcron/commitdiff
Merge remote-tracking branch 'origin/master'
authorThibault Godouet <fcron@free.fr>
Wed, 26 Dec 2012 18:20:22 +0000 (18:20 +0000)
committerThibault Godouet <fcron@free.fr>
Wed, 26 Dec 2012 18:20:22 +0000 (18:20 +0000)
Conflicts:
fileconf.c

1  2 
fileconf.c

diff --cc fileconf.c
index 7197fb04407886c86cb33f91c0fc53482355bed4,ced31d532c88f3aabcd88714c26648ae85e30735..2b446ab1b7b5f3656c89c78686eaf0b48bff3a0f
@@@ -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);