- if ('\\' == (*bufp)[pos] && '}' == (*bufp)[pos + 1])
- return(roff_ccond
- (r, ROFF_ccond, bufp, szp,
- ln, pos, pos + 2, offs));
+ /*
+ * Jump through hoops to detect a \}, because it could
+ * be (say) \\}, which is something completely
+ * different.
+ */
+ ep = &(*bufp)[pos];
+ for ( ; NULL != (ep = strchr(ep, '\\')); ep++) {
+ ep++;
+ if ('}' != *ep)
+ continue;
+ *--ep = '\0';
+ roff_ccond(r, ROFF_ccond, bufp, szp,
+ ln, pos, pos + 2, offs);
+ break;
+ }