1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
|
*** correct.c Thu Oct 12 12:04:06 1995
--- correct.c.3.1.20b Tue Oct 5 12:55:03 1999
***************
*** 1488,1500 ****
* all that likely).
*/
bufsize = strlen (contextbufs[0]);
! if (contextbufs[0][bufsize - 1] == '\n')
! {
! hadnl = 1;
! contextbufs[0][--bufsize] = '\0';
! }
! else
! hadnl = 0;
if (bufsize == (sizeof contextbufs[0]) / 2 - 1)
{
ch = (unsigned char) contextbufs[0][bufsize - 1];
--- 1488,1494 ----
* all that likely).
*/
bufsize = strlen (contextbufs[0]);
! hadnl = (contextbufs[0][bufsize - 1] == '\n');
if (bufsize == (sizeof contextbufs[0]) / 2 - 1)
{
ch = (unsigned char) contextbufs[0][bufsize - 1];
***************
*** 1556,1564 ****
--- 1550,1562 ----
}
else if (contextbufs[0][0] == '~')
{
+ if (hadnl)
+ contextbufs[0][bufsize - 1] = '\0';
defdupchar = findfiletype (&contextbufs[0][1], 1, (int *) NULL);
if (defdupchar < 0)
defdupchar = 0;
+ if (hadnl)
+ contextbufs[0][bufsize - 1] = '\n';
}
else
{
*** defmt.c Thu Oct 12 12:04:06 1995
--- defmt.c.3.1.20b Tue Oct 5 12:54:41 1999
***************
*** 548,554 ****
(void) fprintf (ofile, "%s", ctoken);
}
! if (!lflag && (aflag || hadlf))
(void) putc ('\n', ofile);
}
--- 548,554 ----
(void) fprintf (ofile, "%s", ctoken);
}
! if (!lflag && hadlf)
(void) putc ('\n', ofile);
}
***************
*** 588,593 ****
--- 588,595 ----
return 0;
}
+ /* Updates bufp to point to the next character to skip. */
+ /* Should only be called on non-word characters. */
static int TeX_math_begin (bufp)
char ** bufp;
{
***************
*** 604,613 ****
if (**bufp == TEXLEFTPAREN || **bufp == TEXLEFTSQUARE)
return 1;
else if (!isalpha(**bufp) && **bufp != '@')
! {
! (*bufp)++;
! continue;
! }
else if (TeX_strncmp (*bufp, "begin", 5) == 0)
{
if (TeX_math_check ('b', bufp))
--- 606,612 ----
if (**bufp == TEXLEFTPAREN || **bufp == TEXLEFTSQUARE)
return 1;
else if (!isalpha(**bufp) && **bufp != '@')
! return 0;
else if (TeX_strncmp (*bufp, "begin", 5) == 0)
{
if (TeX_math_check ('b', bufp))
***************
*** 637,648 ****
{
if (*(*bufp)++ == TEXDOT
&& (**bufp == TEXRIGHTSQUARE || **bufp == TEXRIGHTANGLE))
! return TeX_math_begin (bufp);
}
- return 0;
}
! else
! return 0;
}
static int TeX_LR_begin (bufp)
--- 636,645 ----
{
if (*(*bufp)++ == TEXDOT
&& (**bufp == TEXRIGHTSQUARE || **bufp == TEXRIGHTANGLE))
! break;
}
}
! return 0;
}
static int TeX_LR_begin (bufp)
|