3 This patch contains several fixes to NetBSD's indent and should be
4 applied before using pgindent.
6 ---------------------------------------------------------------------------
9 ===================================================================
10 RCS file: /cvsroot/src/usr.bin/indent/README,v
11 retrieving revision 1.1
13 *** README 9 Apr 1993 12:59:06 -0000 1.1
14 --- README 15 Nov 2005 00:25:43 -0000
19 + This patch is from NetBSD current, 2005-11-14. It contains all the
20 + patches need for its use in PostgreSQL.
24 + ---------------------------------------------------------------------------
28 This is the C indenter, it originally came from the University of Illinois
29 via some distribution tape for PDP-11 Unix. It has subsequently been
30 hacked upon by James Gosling @ CMU. It isn't very pretty, and really needs
32 ===================================================================
33 RCS file: /cvsroot/src/usr.bin/indent/indent_globs.h,v
34 retrieving revision 1.8
35 diff -c -r1.8 indent_globs.h
36 *** indent_globs.h 7 Aug 2003 11:14:08 -0000 1.8
37 --- indent_globs.h 15 Nov 2005 00:25:44 -0000
40 scomf, /* Same line comment font */
41 bodyf; /* major body font */
43 ! #define STACK_SIZE 150
45 EXTERN struct parser_state {
48 scomf, /* Same line comment font */
49 bodyf; /* major body font */
52 ! * This controls the maximum number of 'else if' clauses supported.
53 ! * If it is exceeded, comments are placed in column 100.
55 ! #define STACK_SIZE 1000
57 EXTERN struct parser_state {
60 ===================================================================
61 RCS file: /cvsroot/src/usr.bin/indent/lexi.c,v
62 retrieving revision 1.12
64 *** lexi.c 7 Aug 2003 11:14:09 -0000 1.12
65 --- lexi.c 15 Nov 2005 00:25:44 -0000
71 ! struct templ specials[1000] =
79 ! struct templ specials[16384] =
87 if (p >= specials + sizeof specials / sizeof specials[0])
88 ! return; /* For now, table overflows are silently
96 if (p >= specials + sizeof specials / sizeof specials[0])
98 ! fprintf(stderr, "indent: typedef table overflow\n");
106 ===================================================================
107 RCS file: /cvsroot/src/usr.bin/indent/parse.c,v
108 retrieving revision 1.7
109 diff -c -r1.7 parse.c
110 *** parse.c 7 Aug 2003 11:14:09 -0000 1.7
111 --- parse.c 15 Nov 2005 00:25:44 -0000
116 } /* end of switch */
118 + if (ps.tos >= STACK_SIZE) {
119 + fprintf(stderr, "indent: stack size overflow\n");
123 reduce(); /* see if any reduction can be done */
127 ===================================================================
128 RCS file: /cvsroot/src/usr.bin/indent/pr_comment.c,v
129 retrieving revision 1.9
130 diff -c -r1.9 pr_comment.c
131 *** pr_comment.c 7 Aug 2003 11:14:09 -0000 1.9
132 --- pr_comment.c 15 Nov 2005 00:25:44 -0000
138 ! if (*buf_ptr == '-' || *buf_ptr == '*' || *buf_ptr == '\n') {
139 ps.box_com = true; /* a comment with a '-', '*'
140 * or newline immediately
141 * after the start comment is
147 ! * Don't process '\n' or every comment is treated as a
148 ! * block comment, meaning there is no wrapping.
150 ! if (*buf_ptr == '-' || *buf_ptr == '*') {
151 ps.box_com = true; /* a comment with a '-', '*'
152 * or newline immediately
153 * after the start comment is
159 } while (*buf_ptr == ' ' || *buf_ptr == '\t');
162 + * If there is a blank comment line, we need to prefix
163 + * the line with the same three spaces that "/* " takes up.
164 + * Without this code, blank stared lines in comments have
165 + * three too-many characters on the line when wrapped.
167 + if (s_com == e_com) {
168 + *e_com++ = ' '; /* add blanks for continuation */
174 if (++buf_ptr >= buf_end)