1- /* Copyright (C) 2000-2003 Free Software Foundation, Inc.
1+ /* Copyright (C) 2000-2004 Free Software Foundation, Inc.
22 This file is part of the GNU LIBICONV Library.
33
44 The GNU LIBICONV Library is free software; you can redistribute it
4545
4646#define _ (str ) gettext(str)
4747
48- #if O_BINARY
49- static int force_binary = 0 ;
50- #endif
51-
5248static int discard_unconvertible = 0 ;
5349static int silent = 0 ;
5450
5551static void usage (int exitcode )
5652{
5753 const char * helpstring1 =
58- #if O_BINARY
59- _ ("Usage: iconv [--binary] [-c] [-s] [-f fromcode] [-t tocode] [file ...]" );
60- #else
6154 _ ("Usage: iconv [-c] [-s] [-f fromcode] [-t tocode] [file ...]" );
62- #endif
6355 const char * helpstring2 =
6456 _ ("or: iconv -l" );
6557 fprintf (exitcode ? stderr : stdout , "%s\n%s\n" , helpstring1 , helpstring2 );
@@ -100,8 +92,7 @@ static int convert (iconv_t cd, FILE* infile, const char* infilename)
10092 int status = 0 ;
10193
10294#if O_BINARY
103- if (force_binary )
104- SET_BINARY (fileno (infile ));
95+ SET_BINARY (fileno (infile ));
10596#endif
10697 iconv (cd ,NULL ,NULL ,NULL ,NULL );
10798 for (;;) {
@@ -263,8 +254,8 @@ int main (int argc, char* argv[])
263254 print_version ();
264255 }
265256#if O_BINARY
257+ /* Backward compatibility with iconv <= 1.9.1. */
266258 if (!strcmp (argv [i ],"--binary" )) {
267- force_binary = 1 ;
268259 i ++ ;
269260 continue ;
270261 }
@@ -291,8 +282,7 @@ int main (int argc, char* argv[])
291282 status = 0 ;
292283 } else {
293284#if O_BINARY
294- if (force_binary )
295- SET_BINARY (fileno (stdout ));
285+ SET_BINARY (fileno (stdout ));
296286#endif
297287 if (fromcode == NULL )
298288 fromcode = "char" ;
0 commit comments