[BACK]Return to term.c CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

Diff for /mandoc/term.c between version 1.24 and 1.25

version 1.24, 2009/02/26 14:56:27 version 1.25, 2009/02/26 16:08:11
Line 17 
Line 17 
  * PERFORMANCE OF THIS SOFTWARE.   * PERFORMANCE OF THIS SOFTWARE.
  */   */
 #include <assert.h>  #include <assert.h>
   #include <ctype.h>
 #include <err.h>  #include <err.h>
 #include <stdio.h>  #include <stdio.h>
 #include <stdlib.h>  #include <stdlib.h>
Line 276  const struct termact *termacts = __termacts;
Line 277  const struct termact *termacts = __termacts;
 static size_t  static size_t
 arg_width(const struct mdoc_arg *arg)  arg_width(const struct mdoc_arg *arg)
 {  {
           size_t           len, i, v;
   
         /* TODO */          /* TODO */
         assert(*arg->value);          assert(*arg->value);
           if (0 == strcmp(*arg->value, "indent"))
                   return(INDENT);
           if (0 == strcmp(*arg->value, "indent-two"))
                   return(INDENT * 2);
   
           len = strlen(*arg->value);
           assert(len > 0);
   
           for (i = 0; i < len - 1; i++)
                   if ( ! isdigit((int)(*arg->value)[i]))
                           break;
   
           if (i == len - 1) {
                   if ('n' == (*arg->value)[len - 1]) {
                           v = (size_t)atoi(*arg->value);
                           return(v);
                   }
   
           }
         return(strlen(*arg->value));          return(strlen(*arg->value));
 }  }
   
Line 293  arg_offset(const struct mdoc_arg *arg)
Line 314  arg_offset(const struct mdoc_arg *arg)
                 return(INDENT);                  return(INDENT);
         if (0 == strcmp(*arg->value, "indent-two"))          if (0 == strcmp(*arg->value, "indent-two"))
                 return(INDENT * 2);                  return(INDENT * 2);
   
         return(strlen(*arg->value));          return(strlen(*arg->value));
 }  }
   

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.25

CVSweb