# HG changeset patch # User David A. Holland # Date 1364743342 14400 # Node ID ca5e4e0237f5c5837929d2b4b7a7d56cdc50b4dc # Parent 8eee66a255338c722445ddb62a02c3d653f9d0db# Parent f8507e5ed84ceaa48dcd4252c4a13cf1ae37d366 merge diff -r 8eee66a25533 -r ca5e4e0237f5 directive.c --- a/directive.c Sun Mar 31 08:06:40 2013 +0200 +++ b/directive.c Sun Mar 31 11:22:22 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'); diff -r 8eee66a25533 -r ca5e4e0237f5 tests/Makefile --- a/tests/Makefile Sun Mar 31 08:06:40 2013 +0200 +++ b/tests/Makefile Sun Mar 31 11:22:22 2013 -0400 @@ -3,7 +3,7 @@ TESTS=\ t01 t02 t03 t04 t05 t06 t07 t08 t09 t10 t11 t12 t13 t14 t15 t16 \ - t17 t18 t19 + t17 t18 t19 t20 t21 all: run-tests .WAIT show-diffs diff -r 8eee66a25533 -r ca5e4e0237f5 tests/t20.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/t20.c Sun Mar 31 11:22:22 2013 -0400 @@ -0,0 +1,1 @@ +#undef foo /* blah */ diff -r 8eee66a25533 -r ca5e4e0237f5 tests/t20.good diff -r 8eee66a25533 -r ca5e4e0237f5 tests/t21.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/t21.c Sun Mar 31 11:22:22 2013 -0400 @@ -0,0 +1,3 @@ +# define FOO BAR + #undef FOO /* would be wrong */ +FOO diff -r 8eee66a25533 -r ca5e4e0237f5 tests/t21.good --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/t21.good Sun Mar 31 11:22:22 2013 -0400 @@ -0,0 +1,2 @@ + #undef BAR +BAR