Mercurial > ~dholland > hg > tradcpp > index.cgi
diff directive.c @ 66:f8507e5ed84c
Recognize directive lines only when the # is exactly in column 0.
This is the traditional behavior and Joerg's convinced me it's
important to retain it.
author | David A. Holland |
---|---|
date | Sun, 31 Mar 2013 10:47:08 -0400 |
parents | f50b4ea6cbfe |
children | b1d0f10e8d36 |
line wrap: on
line diff
--- a/directive.c Sun Mar 31 02:18:24 2013 -0400 +++ b/directive.c Sun Mar 31 10:47:08 2013 -0400 @@ -571,12 +571,11 @@ p->column += acomm; } - /* check if we have a directive line */ - skip = strspn(line + acomm, ws); - if (acomm == 0 && line[skip] == '#') { + /* check if we have a directive line (# exactly in column 0) */ + if (acomm == 0 && line[0] == '#') { char ch; - skip = skip + 1 + strspn(line + skip + 1, ws); + skip = 1 + strspn(line + 1, ws); assert(skip <= text); p->column += skip; assert(line[len] == '\0');