summaryrefslogtreecommitdiff
path: root/devel/gindent/files/patch-args.c
diff options
context:
space:
mode:
authorJohan van Selst <johans@FreeBSD.org>2010-06-27 14:52:20 +0000
committerJohan van Selst <johans@FreeBSD.org>2010-06-27 14:52:20 +0000
commit224eb510f9a7984f269b98c4d274fbc38433166f (patch)
treeb8bb9e019e50e802f6db82b20a344b6e729303fa /devel/gindent/files/patch-args.c
parentUpdate to the 20100626 snapshot of GCC 4.6.0. (diff)
Apply two bug fixes from John Hein:
1) fix 'indent -npro -nip' when compiled with BERKELEY_DEFAULTS symptom: command line: unknown option "nhnl" Note that the "nhnl" above is just luck due to layout by the compiler. It could be random garbage. explanation: PRO_SETTINGS lists need to be terminated with two nulls. 2) fix error message for args prefixed with '--', like 'indent -npro --no-such-arg' symptom: command line: unknown option "-no-such-arg" explanation: the error message uses 'option - 1' instead of 'option - option_length' and -- options have option_length == 2. Note that the update looks more complicated than just this patch, because the original port patches were re-aligned as well. John has submitted his patches upstream as well. Submitted by: John Hein <jhein@symmetricom.com> Feature safe: yes
Diffstat (limited to 'devel/gindent/files/patch-args.c')
-rw-r--r--devel/gindent/files/patch-args.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/devel/gindent/files/patch-args.c b/devel/gindent/files/patch-args.c
index 970bdf148f61..81fc4266598b 100644
--- a/devel/gindent/files/patch-args.c
+++ b/devel/gindent/files/patch-args.c
@@ -1,5 +1,5 @@
--- src/args.c.orig 2008-03-11 19:50:42.000000000 +0100
-+++ src/args.c 2009-03-08 13:04:43.000000000 +0100
++++ src/args.c 2010-06-27 16:29:54.000000000 +0200
@@ -163,6 +163,7 @@
static int exp_i = 0;
static int exp_il = 0;
@@ -72,8 +72,9 @@
+ {"npcs", PRO_BOOL, true, OFF, &settings.proc_calls_space, &exp_pcs},
{"nlps", PRO_BOOL, false, OFF, &settings.leave_preproc_space, &exp_lps},
{"nlp", PRO_BOOL, true, OFF, &settings.lineup_to_parens, &exp_lp},
- {"nip", PRO_SETTINGS, 0, ONOFF_NA, (int *) "-ip0", &exp_nip},
+- {"nip", PRO_SETTINGS, 0, ONOFF_NA, (int *) "-ip0", &exp_nip},
- {"nhnl", PRO_BOOL, true, OFF, &settings.honour_newlines, &exp_hnl},
++ {"nip", PRO_SETTINGS, 0, ONOFF_NA, (int *) "-ip0\0", &exp_nip},
+ {"nhnl", PRO_BOOL, false, OFF, &settings.honour_newlines, &exp_hnl},
{"nfca", PRO_BOOL, true, OFF, &settings.format_comments, &exp_fca},
{"nfc1", PRO_BOOL, true, OFF, &settings.format_col1_comments, &exp_fc1},
@@ -186,3 +187,12 @@
{"berkeley-style", "orig"},
{"berkeley", "orig"},
{"Bill-Shannon", "bs"},
+@@ -798,7 +830,7 @@
+
+ if (!found)
+ {
+- DieError(invocation_error, _("%s: unknown option \"%s\"\n"), option_source, option - 1);
++ DieError(invocation_error, _("%s: unknown option \"%s\"\n"), option_source, option - option_length);
+ }
+ else
+ {