comparison 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
comparison
equal deleted inserted replaced
65:161edab0d361 66:f8507e5ed84c
569 output(p, line, acomm); 569 output(p, line, acomm);
570 } 570 }
571 p->column += acomm; 571 p->column += acomm;
572 } 572 }
573 573
574 /* check if we have a directive line */ 574 /* check if we have a directive line (# exactly in column 0) */
575 skip = strspn(line + acomm, ws); 575 if (acomm == 0 && line[0] == '#') {
576 if (acomm == 0 && line[skip] == '#') {
577 char ch; 576 char ch;
578 577
579 skip = skip + 1 + strspn(line + skip + 1, ws); 578 skip = 1 + strspn(line + 1, ws);
580 assert(skip <= text); 579 assert(skip <= text);
581 p->column += skip; 580 p->column += skip;
582 assert(line[len] == '\0'); 581 assert(line[len] == '\0');
583 /* ensure null termination for directives */ 582 /* ensure null termination for directives */
584 ch = line[text]; 583 ch = line[text];