bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-tar] why the ifdef around setlocale etc. in tar 1.15.1?


From: Paul Eggert
Subject: [Bug-tar] why the ifdef around setlocale etc. in tar 1.15.1?
Date: Tue, 21 Dec 2004 14:33:50 -0800

Re the changes quoted below: why are they needed?  system.h defines
setlocale to be nothing, if !HAVE_SETLOCALE.  And (via gettext.h) it
also defines bindtextdomain and textdomain appropriately, if
ENABLE_NLS is not defined.

Also, setlocale is somewhat independent of ENABLE_NLS.  ENABLE_NLS is
only about messages; setlocale is also about other things (e.g.,
dates, numbers, etc).

The simplest fix is to undo these changes, but first I'd like to know
why they were needed.

2004-12-21  Sergey Poznyakoff  <address@hidden>

        * src/tar.c (main): Protect invocation of setlocale by
        ifdef.

--- tar-1.15/rmt/rmt.c  2004-09-06 06:49:41 -0700
+++ tar-1.15.1/rmt/rmt.c        2004-12-21 00:06:26 -0800
@@ -281,10 +281,11 @@ main (int argc, char *const *argv)
      tar, on messages found within error packets.  */
 
   program_name = argv[0];
+#ifdef ENABLE_NLS
   setlocale (LC_ALL, "");
   bindtextdomain (PACKAGE, LOCALEDIR);
   textdomain (PACKAGE);
-
+#endif
   switch (getopt_long (argc, argv, "", long_opts, NULL))
     {
     default:
diff -pru tar-1.15/src/tar.c tar-1.15.1/src/tar.c
--- tar-1.15/src/tar.c  2004-12-18 12:01:07 -0800
+++ tar-1.15.1/src/tar.c        2004-12-21 06:11:26 -0800
@@ -1621,7 +1621,10 @@ main (int argc, char **argv)
 {
   set_start_time ();
   program_name = argv[0];
+
+#ifdef HAVE_SETLOCALE
   setlocale (LC_ALL, "");
+#endif
   bindtextdomain (PACKAGE, LOCALEDIR);
   textdomain (PACKAGE);
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]