about summary refs log tree commit diff
path: root/iconv/iconv_prog.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-11-29 05:00:56 +0000
committerUlrich Drepper <drepper@redhat.com>2001-11-29 05:00:56 +0000
commite0e86ccb1d2848678b5c32f65bf6239ba5fb9d24 (patch)
treed2db260a028fd346925bdc815e3774d3b6135666 /iconv/iconv_prog.c
parentc6baa867d3d57ca3eb89226b44ad696960d869cd (diff)
downloadglibc-e0e86ccb1d2848678b5c32f65bf6239ba5fb9d24.tar.gz
glibc-e0e86ccb1d2848678b5c32f65bf6239ba5fb9d24.tar.xz
glibc-e0e86ccb1d2848678b5c32f65bf6239ba5fb9d24.zip
Update.
	* iconv/gconv_open.c (__gconv_open): Empty codeset name now means using
	the current locale's codeset.
	* iconv/iconv_open.c (iconv_open): Don't strip out everything for
	empty input string.
	* iconv/iconv_prog.c: Pass empty strings as default value for to-
	and from-charset.  Don't determine locale's charset here.

	if libio is used [PR libc/2575].
Diffstat (limited to 'iconv/iconv_prog.c')
-rw-r--r--iconv/iconv_prog.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/iconv/iconv_prog.c b/iconv/iconv_prog.c
index e71f8d7369..07296f07f0 100644
--- a/iconv/iconv_prog.c
+++ b/iconv/iconv_prog.c
@@ -25,7 +25,6 @@
 #include <error.h>
 #include <fcntl.h>
 #include <iconv.h>
-#include <langinfo.h>
 #include <locale.h>
 #include <search.h>
 #include <stdio.h>
@@ -92,9 +91,11 @@ static struct argp argp =
   options, parse_opt, args_doc, doc, NULL, more_help
 };
 
-/* Code sets to convert from and to respectively.  */
-static const char *from_code;
-static const char *to_code;
+/* Code sets to convert from and to respectively.  An empty string as the
+   default causes the 'iconv_open' function to look up the charset of the
+   currently selected locale and use it.  */
+static const char *from_code = "";
+static const char *to_code = "";
 
 /* File to write output to.  If NULL write to stdout.  */
 static const char *output_file;
@@ -141,20 +142,6 @@ main (int argc, char *argv[])
       print_known_names ();
       exit (EXIT_SUCCESS);
     }
-  if (from_code == NULL)
-    {
-      /* The Unix standard says that in this case the charset of the current
-	 locale is used.  */
-      from_code = nl_langinfo (CODESET);
-      assert (from_code != NULL);
-    }
-  if (to_code == NULL)
-    {
-      /* The Unix standard says that in this case the charset of the current
-	 locale is used.  */
-      to_code = nl_langinfo (CODESET);
-      assert (to_code != NULL);
-    }
 
   /* If we have to ignore errors make sure we use the appropriate name for
      the to-character-set.  */