aboutsummaryrefslogtreecommitdiff
path: root/russian/rux/files/patch-rux.c
blob: 5f8f70615749cf2a4bc0bede338faa5b576184b9 (plain) (blame)
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
--- rux.c.orig	Sun Dec 25 00:22:01 2005
+++ rux.c	Sun Jan  1 15:46:52 2006
@@ -70,9 +70,10 @@
 	extern int optind;
 
 	char *buf = NULL;		/* analizing buffer */
+	int flag;	
+	int readstdin = 0;              /* read from stdin */
 
 	o_cp = &codepage[2];		/* sets koi8-r as default outcp */
-	int flag;
 
 	while ((flag = getopt(argc, argv, "i:o:thegTs:")) != -1) {
 		switch (flag) {
@@ -133,19 +134,18 @@
 		}
 	}
 
-	int readstdin = 0;		/* read from stdin */
-
 	if (argc == 0)
 		readstdin = 1;
 
 	while (1) {
+		int buflen = 0;
+
 		if (readstdin) {
 			in = stdin;
 		} else if ((in = fopen(*argv, "r")) == NULL) {
 			perror(*argv);
 			return errno;
 		}
-		int buflen = 0;
 
 		if (fdetect) {
 			buflen = fread(buf, 1, ansize, in);