Debian Codegraph @

debian/patches/try_utf8_fix

raw
1 Description: if-def out a variable that is unused if TRY_UTF8.
2 Author: Baruch Even <[email protected]>
3
4 --- a/bidiv.c
5 +++ b/bidiv.c
6 @@ -24,6 +24,7 @@
7
8 /* In the future, this should be done with autoconf */
9 #define HAVE_LOCALE
10 +#define TRY_UTF8
11
12 #ifdef HAVE_LOCALE
13 #include <locale.h>
14 @@ -47,7 +48,10 @@ int out_utf8=0;
15 void
16 bidiv(FILE *fp)
17 {
18 - char *in, *out;
19 +#ifndef TRY_UTF8
20 + char *in;
21 +#endif
22 + char *out;
23 FriBidiChar *unicode_in, *unicode_out;
24 int len, i, c;
25 int rtl_line;
26 @@ -62,7 +66,9 @@ bidiv(FILE *fp)
27 */
28 int newline=1, newpara=1;
29
30 +#ifndef TRY_UTF8
31 in=(char *)malloc(width+1);
32 +#endif
33 out=(char *)malloc(width*7+1); /* 7 is the maximum number of
34 bytes in one UTF8 char? */
35 /* We use (width+1) not just width, to leave place for a double-
36 @@ -101,7 +107,6 @@ bidiv(FILE *fp)
37 option to bidiv. This is enabled when TRY_UTF8
38 is defined
39 */
40 -#define TRY_UTF8
41 if((c=getc(fp))==EOF)
42 break;
43 else if(c=='\r'){
44 @@ -216,7 +221,9 @@ bidiv(FILE *fp)
45 puts(out);
46 }
47 /* Free the memory we have allocated */
48 +#ifndef TRY_UTF8
49 free(in);
50 +#endif
51 free(out);
52 free(unicode_in);
53 free(unicode_out);