Revision 11cb6202 filter/filter.c

View differences:

filter/filter.c
69 69
  }
70 70
}
71 71

  
72
static void
73
pm_format(struct f_path_mask *p, byte *buf, unsigned int size)
74
{
75
  byte *end = buf + size - 16;
76

  
77
  while (p)
78
    {
79
      if (buf > end)
80
	{
81
	  strcpy(buf, " ...");
82
	  return;
83
	}
84

  
85
      if (p->any)
86
	buf += bsprintf(buf, "? ");
87
      else
88
	buf += bsprintf(buf, "%u ", p->val);
89

  
90
      p = p->next;
91
    }
92

  
93
  *buf = 0;
94
}
95

  
72 96
/**
73 97
 * val_compare - compare two values
74 98
 * @v1: first value
......
224 248
  case T_ENUM: PRINTF( "(enum %x)%d", v.type, v.val.i ); break;
225 249
  case T_PATH: as_path_format(v.val.ad, buf2, 1020); PRINTF( "(path %s)", buf2 ); break;
226 250
  case T_CLIST: int_set_format(v.val.ad, buf2, 1020); PRINTF( "(clist %s)", buf2 ); break;
227
  case T_PATH_MASK: debug( "(pathmask " ); { struct f_path_mask *p = v.val.path_mask; while (p) { debug("%d ", p->val); p=p->next; } debug(")" ); } break;
251
  case T_PATH_MASK: pm_format(v.val.path_mask, buf2, 1020); PRINTF( "(pathmask %s)", buf2 ); break;
228 252
  default: PRINTF( "[unknown type %x]", v.type );
229 253
#undef PRINTF
230 254
  }

Also available in: Unified diff