@@ -229,7 +229,7 @@ static void pyformat(FILE *file, FILE *out, struct vlbuf *origfile,
229
229
if (origfile ) {
230
230
if (origfile -> len < rlen + origfilelen )
231
231
vlbuf_expand (origfile , rlen + origfilelen );
232
- strncpy (& origfile -> d .ch [origfilelen ], & linebuf .d .ch [llen ], rlen );
232
+ memcpy (& origfile -> d .ch [origfilelen ], & linebuf .d .ch [llen ], rlen + 1 );
233
233
origfilelen += rlen ;
234
234
}
235
235
llen += rlen ;
@@ -536,6 +536,7 @@ static void pyformat(FILE *file, FILE *out, struct vlbuf *origfile,
536
536
++ tokd ;
537
537
/* convert label to special if it's a word in a list we have */
538
538
if (otok == TOK_LABEL ) {
539
+ /* todo: run constructed state machine to check if word in group. */
539
540
for (const char * * cc = & specnames [0 ]; * cc ; ++ cc ) {
540
541
if (strcmp (* cc , stokd ) == 0 ) {
541
542
otok = TOK_SPECIAL ;
@@ -617,7 +618,6 @@ static void pyformat(FILE *file, FILE *out, struct vlbuf *origfile,
617
618
buildpt += strapp (buildpt , "# " );
618
619
}
619
620
buildpt += strapp (buildpt , sos );
620
- buildpt += strapp (buildpt , "!#" );
621
621
splitpoints .d .in [nsplits ] = buildpt - laccum .d .ch ;
622
622
split_ratings .d .in [nsplits ] = -1 ;
623
623
split_nestings .d .in [nsplits ] = nests ;
@@ -719,9 +719,6 @@ static void pyformat(FILE *file, FILE *out, struct vlbuf *origfile,
719
719
int fr = i > 0 ? splitpoints .d .in [i - 1 ] : 0 ;
720
720
int to = i >= nsplits - 1 ? eoff : splitpoints .d .in [i ];
721
721
memcpy (lineout .d .ch , & laccum .d .ch [fr ], to - fr );
722
- if (split_ratings .d .in [i ] < 0 ) {
723
- to -= 2 ;
724
- }
725
722
lineout .d .ch [to - fr ] = '\0' ;
726
723
int nlen = to - fr ;
727
724
int force_split = i > 0 ? split_ratings .d .in [i - 1 ] < 0 : 0 ;
@@ -733,9 +730,6 @@ static void pyformat(FILE *file, FILE *out, struct vlbuf *origfile,
733
730
int fr = k > 0 ? splitpoints .d .in [k - 1 ] : 0 ;
734
731
int ofr = k > 1 ? splitpoints .d .in [k - 2 ] : 0 ;
735
732
int to = k >= nsplits - 1 ? eoff : splitpoints .d .in [k ];
736
- if (split_ratings .d .in [k ] < 0 ) {
737
- to -= 2 ;
738
- }
739
733
int len = to - fr ;
740
734
int isc = 100 ;
741
735
/* Just by previous. Q: split tok? or 'saved length' field, w/
0 commit comments