summaryrefslogtreecommitdiff
path: root/editors/ssam/patches/patch-ab
blob: 858b67a6f2c4d0c71bfd616bbfd7a1a0efcfbb29 (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
26
27
28
29
30
31
32
33
34
35
36
37
$NetBSD: patch-ab,v 1.1 2002/09/26 09:48:32 agc Exp $

--- main.c	2002/09/26 09:40:23	1.1
+++ main.c	2002/09/26 09:40:51
@@ -109,11 +109,12 @@
 	char	*f;
 	char	*collseq;
 	int	flags;
+	int	off;
 	int	i;
 
 	(void) memset(&sam, 0, sizeof(sam));
 	command = f = (char *) NULL;
-	flags = 0;
+	off = flags = 0;
 	collseq = getenv("UTFCOLLSEQ");
 	while ((i = getopt(argc, argv, "a:bf:nvwx")) != -1) {
 		switch(i) {
@@ -124,6 +125,7 @@
 			flags |= ByteOffsets;
 			break;
 		case 'f':
+			off = 1;
 			f = optarg;
 			break;
 		case 'n':
@@ -146,8 +148,8 @@
 	if ((command = getcommand(f, &argv[optind])) == (char *) NULL) {
 		exit(1);
 	}
-	argc -= optind + 1;
-	argv += optind + 1;
+	argc -= optind + 1 - off;
+	argv += optind + 1 - off;
 	if (!ssamfiles(&sam, argc, argv)) {
 		exit(1);
 	}