Commit 360429e1 authored by Bruce Momjian's avatar Bruce Momjian

Fix pg_bsd_indent bug where newlines were not being trimmed from typedef

lines.  Update pg_bsd_indent required version to 1.1 (and update ftp
site).

Problem reported by Magnus.
parent d9bae531
...@@ -379,11 +379,10 @@ progress_report(int tablespacenum, const char *filename) ...@@ -379,11 +379,10 @@ progress_report(int tablespacenum, const char *filename)
char totalsize_str[32]; char totalsize_str[32];
/* /*
* Avoid overflowing past 100% or the full size. This may make the * Avoid overflowing past 100% or the full size. This may make the total
* total size number change as we approach the end of the backup * size number change as we approach the end of the backup (the estimate
* (the estimate will always be wrong if WAL is included), but * will always be wrong if WAL is included), but that's better than having
* that's better than having the done column be bigger than the * the done column be bigger than the total.
* total.
*/ */
if (percent > 100) if (percent > 100)
percent = 100; percent = 100;
...@@ -391,9 +390,9 @@ progress_report(int tablespacenum, const char *filename) ...@@ -391,9 +390,9 @@ progress_report(int tablespacenum, const char *filename)
totalsize = totaldone / 1024; totalsize = totaldone / 1024;
/* /*
* Separate step to keep platform-dependent format code out of translatable * Separate step to keep platform-dependent format code out of
* strings. And we only test for INT64_FORMAT availability in snprintf, * translatable strings. And we only test for INT64_FORMAT availability
* not fprintf. * in snprintf, not fprintf.
*/ */
snprintf(totaldone_str, sizeof(totaldone_str), INT64_FORMAT, totaldone / 1024); snprintf(totaldone_str, sizeof(totaldone_str), INT64_FORMAT, totaldone / 1024);
snprintf(totalsize_str, sizeof(totalsize_str), INT64_FORMAT, totalsize); snprintf(totalsize_str, sizeof(totalsize_str), INT64_FORMAT, totalsize);
...@@ -410,7 +409,7 @@ progress_report(int tablespacenum, const char *filename) ...@@ -410,7 +409,7 @@ progress_report(int tablespacenum, const char *filename)
ngettext("%s/%s kB (100%%), %d/%d tablespace %35s", ngettext("%s/%s kB (100%%), %d/%d tablespace %35s",
"%s/%s kB (100%%), %d/%d tablespaces %35s", "%s/%s kB (100%%), %d/%d tablespaces %35s",
tablespacecount), tablespacecount),
totaldone_str, totalsize_str, tablespacenum, tablespacecount, ""); totaldone_str, totalsize_str, tablespacenum, tablespacecount, "");
else else
fprintf(stderr, fprintf(stderr,
ngettext("%s/%s kB (%d%%), %d/%d tablespace (%-30.30s)", ngettext("%s/%s kB (%d%%), %d/%d tablespace (%-30.30s)",
......
diff -c -r bsd_indent/Makefile pg_bsd_indent/Makefile diff -c -r bsd_indent/Makefile pg_bsd_indent/Makefile
*** bsd_indent/Makefile Mon Nov 14 19:30:11 2005 *** bsd_indent/Makefile Wed Oct 26 17:13:34 2011
--- pg_bsd_indent/Makefile Wed Oct 12 12:17:12 2011 --- pg_bsd_indent/Makefile Wed Oct 12 12:17:12 2011
*************** ***************
*** 2,10 **** *** 2,10 ****
...@@ -38,7 +38,7 @@ diff -c -r bsd_indent/Makefile pg_bsd_indent/Makefile ...@@ -38,7 +38,7 @@ diff -c -r bsd_indent/Makefile pg_bsd_indent/Makefile
! install: $(TARGET) ! install: $(TARGET)
install -s -o bin -g bin $(TARGET) /usr/local/bin install -s -o bin -g bin $(TARGET) /usr/local/bin
diff -c -r bsd_indent/README pg_bsd_indent/README diff -c -r bsd_indent/README pg_bsd_indent/README
*** bsd_indent/README Wed Oct 12 11:51:58 2011 *** bsd_indent/README Wed Oct 26 17:13:34 2011
--- pg_bsd_indent/README Mon Nov 14 19:30:24 2005 --- pg_bsd_indent/README Mon Nov 14 19:30:24 2005
*************** ***************
*** 1,3 **** *** 1,3 ****
...@@ -57,15 +57,15 @@ diff -c -r bsd_indent/README pg_bsd_indent/README ...@@ -57,15 +57,15 @@ diff -c -r bsd_indent/README pg_bsd_indent/README
via some distribution tape for PDP-11 Unix. It has subsequently been via some distribution tape for PDP-11 Unix. It has subsequently been
hacked upon by James Gosling @ CMU. It isn't very pretty, and really needs hacked upon by James Gosling @ CMU. It isn't very pretty, and really needs
diff -c -r bsd_indent/args.c pg_bsd_indent/args.c diff -c -r bsd_indent/args.c pg_bsd_indent/args.c
*** bsd_indent/args.c Mon Nov 14 19:30:00 2005 *** bsd_indent/args.c Wed Oct 26 17:13:34 2011
--- pg_bsd_indent/args.c Wed Oct 12 12:30:06 2011 --- pg_bsd_indent/args.c Wed Oct 26 17:16:56 2011
*************** ***************
*** 83,88 **** *** 83,88 ****
--- 83,90 ---- --- 83,90 ----
#include <string.h> #include <string.h>
#include "indent_globs.h" #include "indent_globs.h"
+ #define INDENT_PG_VERSION "1.0" + #define INDENT_PG_VERSION "1.1"
+ +
/* profile types */ /* profile types */
#define PRO_SPECIAL 1 /* special case */ #define PRO_SPECIAL 1 /* special case */
...@@ -125,7 +125,7 @@ diff -c -r bsd_indent/args.c pg_bsd_indent/args.c ...@@ -125,7 +125,7 @@ diff -c -r bsd_indent/args.c pg_bsd_indent/args.c
indent: set_option: internal error: p_special %d\n", p->p_special); indent: set_option: internal error: p_special %d\n", p->p_special);
*************** ***************
*** 459,461 **** *** 459,461 ****
--- 485,509 ---- --- 485,508 ----
exit(1); exit(1);
} }
} }
...@@ -145,17 +145,16 @@ diff -c -r bsd_indent/args.c pg_bsd_indent/args.c ...@@ -145,17 +145,16 @@ diff -c -r bsd_indent/args.c pg_bsd_indent/args.c
+ while ((fgets(line, BUFSIZ, file)) != NULL) + while ((fgets(line, BUFSIZ, file)) != NULL)
+ { + {
+ /* Remove trailing whitespace */ + /* Remove trailing whitespace */
+ if (strstr(line, " \t\n\r") != NULL) + *(line + strcspn(line, " \t\n\r")) = '\0';
+ *strstr(line, " \t\n\r") = '\0';
+ addkey(strdup(line), 4); + addkey(strdup(line), 4);
+ } + }
+ fclose(file); + fclose(file);
+ } + }
Only in pg_bsd_indent/: args.o Only in pg_bsd_indent: args.o
Only in bsd_indent/: indent.bsd.patch Only in pg_bsd_indent: indent.bsd.patch
Only in pg_bsd_indent/: indent.o Only in pg_bsd_indent: indent.o
diff -c -r bsd_indent/indent_globs.h pg_bsd_indent/indent_globs.h diff -c -r bsd_indent/indent_globs.h pg_bsd_indent/indent_globs.h
*** bsd_indent/indent_globs.h Wed Oct 12 11:51:58 2011 *** bsd_indent/indent_globs.h Wed Oct 26 17:13:34 2011
--- pg_bsd_indent/indent_globs.h Mon Nov 14 19:30:24 2005 --- pg_bsd_indent/indent_globs.h Mon Nov 14 19:30:24 2005
*************** ***************
*** 239,245 **** *** 239,245 ****
...@@ -178,9 +177,9 @@ diff -c -r bsd_indent/indent_globs.h pg_bsd_indent/indent_globs.h ...@@ -178,9 +177,9 @@ diff -c -r bsd_indent/indent_globs.h pg_bsd_indent/indent_globs.h
EXTERN struct parser_state { EXTERN struct parser_state {
int last_token; int last_token;
Only in pg_bsd_indent/: io.o Only in pg_bsd_indent: io.o
diff -c -r bsd_indent/lexi.c pg_bsd_indent/lexi.c diff -c -r bsd_indent/lexi.c pg_bsd_indent/lexi.c
*** bsd_indent/lexi.c Wed Oct 12 11:51:58 2011 *** bsd_indent/lexi.c Wed Oct 26 17:13:34 2011
--- pg_bsd_indent/lexi.c Mon Nov 14 19:30:24 2005 --- pg_bsd_indent/lexi.c Mon Nov 14 19:30:24 2005
*************** ***************
*** 93,99 **** *** 93,99 ****
...@@ -221,9 +220,9 @@ diff -c -r bsd_indent/lexi.c pg_bsd_indent/lexi.c ...@@ -221,9 +220,9 @@ diff -c -r bsd_indent/lexi.c pg_bsd_indent/lexi.c
p->rwd = key; p->rwd = key;
p->rwcode = val; p->rwcode = val;
p[1].rwd = 0; p[1].rwd = 0;
Only in pg_bsd_indent/: lexi.o Only in pg_bsd_indent: lexi.o
diff -c -r bsd_indent/parse.c pg_bsd_indent/parse.c diff -c -r bsd_indent/parse.c pg_bsd_indent/parse.c
*** bsd_indent/parse.c Wed Oct 12 11:51:58 2011 *** bsd_indent/parse.c Wed Oct 26 17:13:34 2011
--- pg_bsd_indent/parse.c Mon Nov 14 19:30:24 2005 --- pg_bsd_indent/parse.c Mon Nov 14 19:30:24 2005
*************** ***************
*** 231,236 **** *** 231,236 ****
...@@ -239,9 +238,9 @@ diff -c -r bsd_indent/parse.c pg_bsd_indent/parse.c ...@@ -239,9 +238,9 @@ diff -c -r bsd_indent/parse.c pg_bsd_indent/parse.c
reduce(); /* see if any reduction can be done */ reduce(); /* see if any reduction can be done */
#ifdef debug #ifdef debug
Only in pg_bsd_indent/: parse.o Only in pg_bsd_indent: parse.o
diff -c -r bsd_indent/pr_comment.c pg_bsd_indent/pr_comment.c diff -c -r bsd_indent/pr_comment.c pg_bsd_indent/pr_comment.c
*** bsd_indent/pr_comment.c Wed Oct 12 11:51:58 2011 *** bsd_indent/pr_comment.c Wed Oct 26 17:13:34 2011
--- pg_bsd_indent/pr_comment.c Mon Nov 14 19:30:24 2005 --- pg_bsd_indent/pr_comment.c Mon Nov 14 19:30:24 2005
*************** ***************
*** 148,154 **** *** 148,154 ****
...@@ -286,4 +285,4 @@ diff -c -r bsd_indent/pr_comment.c pg_bsd_indent/pr_comment.c ...@@ -286,4 +285,4 @@ diff -c -r bsd_indent/pr_comment.c pg_bsd_indent/pr_comment.c
} else } else
if (++buf_ptr >= buf_end) if (++buf_ptr >= buf_end)
fill_buffer(); fill_buffer();
Only in pg_bsd_indent/: pr_comment.o Only in pg_bsd_indent: pr_comment.o
...@@ -22,6 +22,7 @@ TYPEDEFS="$1" ...@@ -22,6 +22,7 @@ TYPEDEFS="$1"
shift shift
[ -z "$INDENT" ] && INDENT=pg_bsd_indent [ -z "$INDENT" ] && INDENT=pg_bsd_indent
INDENT_VERSION="1.1"
trap "rm -f /tmp/$$ /tmp/$$a" 0 1 2 3 15 trap "rm -f /tmp/$$ /tmp/$$a" 0 1 2 3 15
...@@ -39,8 +40,8 @@ if [ "$?" -ne 1 ] ...@@ -39,8 +40,8 @@ if [ "$?" -ne 1 ]
then echo "You do not appear to have '$INDENT' installed on your system." >&2 then echo "You do not appear to have '$INDENT' installed on your system." >&2
exit 1 exit 1
fi fi
if [ "`$INDENT -V`" != "$INDENT 1.0" ] if [ "`$INDENT -V`" != "$INDENT $INDENT_VERSION" ]
then echo "You do not appear to have $INDENT version 1.0 installed on your system." >&2 then echo "You do not appear to have $INDENT version $INDENT_VERSION installed on your system." >&2
exit 1 exit 1
fi fi
$INDENT -gnu </dev/null >/dev/null 2>&1 $INDENT -gnu </dev/null >/dev/null 2>&1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment