summaryrefslogtreecommitdiff
blob: cf43e7b9d56c3de278db103f436ee4421aecc843 (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
38
39
40
41
42
43
44
45
46
47
48
49
50
diff -urN aspell-0.50.5.orig/prog/compress.c aspell-0.50.5/prog/compress.c
--- aspell-0.50.5.orig/prog/compress.c	2002-08-31 11:51:11.000000000 -0700
+++ aspell-0.50.5/prog/compress.c	2004-06-09 13:11:46.000000000 -0700
@@ -28,6 +28,9 @@
 
 #endif
 
+int count;
+
+
 void usage () 
 {
   fputs("Compresses or uncompresses sorted word lists.\n"     , stderr);
@@ -47,6 +50,7 @@
     *w++ = (char)(c);
   } while (c = getc(in), c != EOF && c > 32);
   *w = '\0';
+  count++;
   ungetc(c, in);
   if (c == EOF) return 0;
   else return 1;
@@ -69,6 +73,7 @@
 
     SETBIN (stdout);
 
+	while (count < 256) {
     while (get_word(stdin, cur)) {
       int i = 0;
       /* get the length of the prefix */
@@ -85,6 +90,7 @@
 	prev = s2; cur = s1;
       }
     }
+	}
     return 0;
 
   } else if (argv[1][0] == 'd') {
@@ -100,8 +106,11 @@
       if (i == 0)
 	i = getc(stdin);
       --i;  
-      while ((c = getc(stdin)) > 32)
+      while ((c = getc(stdin)) > 32 && count < 256) {
 	cur[i++] = (char)c;
+	count++;
+	}
+
       cur[i] = '\0';
       fputs(cur, stdout);
       putc('\n', stdout);