summaryrefslogtreecommitdiff
path: root/editors/nvi/patches/patch-ah
blob: 40385b2916c3c538ee0209624b712b95be6b4cb4 (plain)
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
$NetBSD: patch-ah,v 1.3 2009/08/07 16:39:21 lukem Exp $

--- ../common/options.awk.orig	2007-11-19 03:41:42.000000000 +1100
+++ ../common/options.awk
@@ -2,6 +2,18 @@
  
 /^\/\* O_[0-9A-Z_]*/ {
-	printf("#define %s %d\n", $2, cnt++);
-	next;
+	opt = $2
+	printf("#define %s %d\n", opt, cnt++)
+	ofs = FS
+	FS="\""
+	do getline
+	while ($1 != "	{L(")
+	FS=ofs
+	opt_name = $2
+	if (opt_name < prev_name) {
+		printf "missorted %s: \"%s\" < \"%s\"\n", opt, opt_name, prev_name >"/dev/stderr"
+		exit 1
+	}
+	prev_name = opt_name
+	next
 }
 END {