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

Diff for /mandoc/roff.c between version 1.45 and 1.46

version 1.45, 2008/12/06 16:50:18 version 1.46, 2008/12/06 19:41:41
Line 623  roffspecial(struct rofftree *tree, int tok, 
Line 623  roffspecial(struct rofftree *tree, int tok, 
 {  {
   
         switch (tok) {          switch (tok) {
           case (ROFF_At):
                   if (0 == sz)
                           break;
                   if (0 == strcmp(*ordp, "v6"))
                           break;
                   else if (0 == strcmp(*ordp, "v7"))
                           break;
                   else if (0 == strcmp(*ordp, "32v"))
                           break;
                   else if (0 == strcmp(*ordp, "V.1"))
                           break;
                   else if (0 == strcmp(*ordp, "V.4"))
                           break;
                   roff_err(tree, start, "invalid `At' arg");
                   return(0);
   
         case (ROFF_Nm):          case (ROFF_Nm):
                 if (0 == sz) {                  if (0 == sz) {
                         if (0 == tree->name[0]) {                          if (0 == tree->name[0]) {
Line 635  roffspecial(struct rofftree *tree, int tok, 
Line 651  roffspecial(struct rofftree *tree, int tok, 
                         return(0);                          return(0);
                 break;                  break;
   
           case (ROFF_Sx):
                   /* FALLTHROUGH*/
         case (ROFF_Ex):          case (ROFF_Ex):
                 if (0 == sz) {                  if (1 != sz) {
                         roff_err(tree, start, "`Ex' expects an arg");                          roff_err(tree, start, "`%s' expects one arg",
                                           toknames[tok]);
                         return(0);                          return(0);
                 } else if (1 != sz) {  
                         roff_err(tree, start, "`Ex' expects one arg");  
                         return(0);  
                 }                  }
                 break;                  break;
   
         case (ROFF_Sm):          case (ROFF_Sm):
                 if (0 == sz) {                  if (1 != sz) {
                         roff_err(tree, start, "`Sm' expects an arg");  
                         return(0);  
                 } else if (1 != sz) {  
                         roff_err(tree, start, "`Sm' expects one arg");                          roff_err(tree, start, "`Sm' expects one arg");
                         return(0);                          return(0);
                 }                  }
Line 663  roffspecial(struct rofftree *tree, int tok, 
Line 676  roffspecial(struct rofftree *tree, int tok, 
   
         case (ROFF_Ud):          case (ROFF_Ud):
                 /* FALLTHROUGH */                  /* FALLTHROUGH */
           case (ROFF_Ux):
                   /* FALLTHROUGH */
         case (ROFF_Bt):          case (ROFF_Bt):
                 if (0 != sz) {                  if (0 != sz) {
                         roff_err(tree, start, "`%s' expects no args",                          roff_err(tree, start, "`%s' expects no args",
Line 963  roffsetname(struct rofftree *tree, char **ordp)
Line 978  roffsetname(struct rofftree *tree, char **ordp)
   
   
 /* ARGSUSED */  /* ARGSUSED */
 static int  
 roff_Sm(ROFFCALL_ARGS)  
 {  
         char            *ordp[1], *p;  
   
         p = *argv++;  
         *ordp = *argv;  
   
         return(roffspecial(tree, tok, p, *ordp ? 1 : 0, ordp));  
 }  
   
   
 /* ARGSUSED */  
 static  int  static  int
 roff_Ns(ROFFCALL_ARGS)  roff_Ns(ROFFCALL_ARGS)
 {  {
Line 1201  roff_ordered(ROFFCALL_ARGS) 
Line 1203  roff_ordered(ROFFCALL_ARGS) 
   
         i = 0;          i = 0;
         while (*argv && i < ROFF_MAXLINEARG) {          while (*argv && i < ROFF_MAXLINEARG) {
                 c = rofffindcallable(*argv);                  c = ROFF_PARSED & tokens[tok].flags ?
                           rofffindcallable(*argv) : ROFF_MAX;
   
                 if (ROFF_MAX == c && ! roffispunct(*argv)) {                  if (ROFF_MAX == c && ! roffispunct(*argv)) {
                         ordp[i++] = *argv++;                          ordp[i++] = *argv++;
Line 1215  roff_ordered(ROFFCALL_ARGS) 
Line 1218  roff_ordered(ROFFCALL_ARGS) 
                 if ( ! roffspecial(tree, tok, p, (size_t)i, ordp))                  if ( ! roffspecial(tree, tok, p, (size_t)i, ordp))
                         return(0);                          return(0);
   
                 return(roffcall(tree, c, ordp));                  return(roffcall(tree, c, argv));
         }          }
   
         assert(i != ROFF_MAXLINEARG);          assert(i != ROFF_MAXLINEARG);

Legend:
Removed from v.1.45  
changed lines
  Added in v.1.46

CVSweb