]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Remove "lt-" prefix from program name.
authorBruno Haible <bruno@clisp.org>
Tue, 15 May 2001 19:59:42 +0000 (19:59 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 15 May 2001 19:59:42 +0000 (19:59 +0000)
12 files changed:
lib/ChangeLog
lib/progname.c
lib/progname.h
src/ChangeLog
src/gettext.c
src/msgcmp.c
src/msgcomm.c
src/msgfmt.c
src/msgmerge.c
src/msgunfmt.c
src/ngettext.c
src/xgettext.c

index 3c966c7386333a36575dad7581b7718b964b2446..d592daeecf042f563576baa4622fca303385c3c0 100644 (file)
@@ -1,3 +1,9 @@
+2001-05-15  Bruno Haible  <haible@clisp.cons.org>
+
+       * progname.h (set_program_name): New declaration.
+       * progname.c: Include <string.h>.
+       (set_program_name): New function.
+
 2001-05-02  Bruno Haible  <haible@clisp.cons.org>
 
        * xerror.h: New file.
index 7068b395bad53d83b2f8d620c793c6b91e165b25..7bf9ff466d590aae1d1616694f1cd57f3baede23 100644 (file)
@@ -22,6 +22,7 @@
 #endif
 
 #include <stdio.h>
+#include <string.h>
 
 #include "progname.h"
 
    To be initialized by main().  */
 const char *program_name;
 
+/* Set program_name, based on argv[0].  */
+void
+set_program_name (argv0)
+     const char *argv0;
+{
+  /* libtool creates a temporary executable whose name is prefixed with
+     "lt-".  Remove this prefix here.  */
+  if (strncmp (argv0, "lt-", 3) == 0)
+    argv0 += 3;
+  program_name = argv0;
+}
+
 /* Indicates whether errors and warnings get prefixed with program_name.
    Default is true.  */
 int error_with_progname = 1;
index 7ddd3063bf3a0afe5f074cc7e71fe7543777c218..aaddd88fa6b9f53e13aad8ffecf8c4067078337f 100644 (file)
    with the program name.
 
    Programs using this file should do the following in main():
-     program_name = argv[0];
+     set_program_name (argv[0]);
      error_print_progname = maybe_print_progname;
  */
 
 /* String containing name the program is called with.  */
 extern const char *program_name;
 
+/* Set program_name, based on argv[0].  */
+extern void set_program_name PARAMS ((const char *argv0));
+
 /* Indicates whether errors and warnings get prefixed with program_name.
    Default is true.
    A reason to omit the prefix is for better interoperability with Emacs'
index fa5af4281775a60c8278f2f003afd3d39db2859e..1104482f3bd29a13abb9ee3bbcfe409653b65b8f 100644 (file)
@@ -1,3 +1,15 @@
+2001-05-15  Bruno Haible  <haible@clisp.cons.org>
+
+       * msgcmp.c (main): Call set_program_name instead of assigning
+       program_name directly.
+       * msgcomm.c (main): Likewise.
+       * msgfmt.c (main): Likewise.
+       * msgmerge.c (main): Likewise.
+       * msgunfmt.c (main): Likewise.
+       * xgettext.c (main): Likewise.
+       * gettext.c (main): Remove "lt-" prefix from program_name.
+       * ngettext.c (main): Likewise.
+
 2001-05-04  Bruno Haible  <haible@clisp.cons.org>
 
        * gettext.c (usage): Add description of what the program does.
index 7bb4330e3a2a616af96f7632ccf403bca1166c08..9a8cbb2d824c7ae8670dae57c7fc1913ad6c28b4 100644 (file)
@@ -23,6 +23,7 @@
 #include <getopt.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <locale.h>
 
 #include "error.h"
@@ -90,6 +91,8 @@ main (argc, argv)
 
   /* Set program name for message texts.  */
   program_name = argv[0];
+  if (strncmp (program_name, "lt-", 3) == 0)
+    program_name += 3;
 
 #ifdef HAVE_SETLOCALE
   /* Set locale via LC_ALL.  */
index 7bff9caef376ee99b0c7314b4255531b136d87c5..7c9f029c13aa259ebd9462aa6810bbd0f377c624 100644 (file)
@@ -92,7 +92,7 @@ main (argc, argv)
   int do_version;
 
   /* Set program name for messages.  */
-  program_name = argv[0];
+  set_program_name (argv[0]);
   error_print_progname = maybe_print_progname;
 
 #ifdef HAVE_SETLOCALE
index 2f236b23c680a53c1549a15f5026459dc047c11f..8e61b3b4c58a015090ca63cce73d9a676eb2ea7e 100644 (file)
@@ -143,7 +143,7 @@ main (argc, argv)
   size_t j;
 
   /* Set program name for messages.  */
-  program_name = argv[0];
+  set_program_name (argv[0]);
   error_print_progname = maybe_print_progname;
 
 #ifdef HAVE_SETLOCALE
index 6b2c681d3e801b488afd60ba2bf73bd02bc72191..338dc5233c3dcf1d95e9f915edc6b8d13cd78b49 100644 (file)
@@ -202,7 +202,7 @@ main (argc, argv)
   alignment = DEFAULT_OUTPUT_ALIGNMENT;
 
   /* Set program name for messages.  */
-  program_name = argv[0];
+  set_program_name (argv[0]);
   error_print_progname = maybe_print_progname;
   error_one_per_line = 1;
   exit_status = EXIT_SUCCESS;
index a09c3f93f77f709d5c22f9508b013707b3ca9788..c7b5729cab8ae97dc6b0d7245bfca8dc3bd5ee88 100644 (file)
@@ -96,7 +96,7 @@ main (argc, argv)
   int sort_by_msgid = 0;
 
   /* Set program name for messages.  */
-  program_name = argv[0];
+  set_program_name (argv[0]);
   error_print_progname = maybe_print_progname;
   verbosity_level = 0;
   quiet = 0;
index f58bd41a0298a122c670773538505c859fe48d22..46a1cfb156a6a3ed76cd914a450d3e2cab94f05a 100644 (file)
@@ -97,7 +97,7 @@ main (argc, argv)
   int sort_by_msgid = 0;
 
   /* Set program name for messages.  */
-  program_name = argv[0];
+  set_program_name (argv[0]);
   error_print_progname = maybe_print_progname;
 
 #ifdef HAVE_SETLOCALE
index 36b1513a2d263a627f34d3954987774c4336f3b7..e08a162f59fdbd3c340df579b31f45a38cace32f 100644 (file)
@@ -22,6 +22,7 @@
 #include <getopt.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <locale.h>
 #include <errno.h>
 
@@ -76,6 +77,8 @@ main (argc, argv)
 
   /* Set program name for message texts.  */
   program_name = argv[0];
+  if (strncmp (program_name, "lt-", 3) == 0)
+    program_name += 3;
 
 #ifdef HAVE_SETLOCALE
   /* Set locale via LC_ALL.  */
index 64afb7ae17895d6f103e8d0aa13437b7059b53d3..d78af98e4d0f6d8d6b5aca5045564693b8026396 100644 (file)
@@ -213,7 +213,7 @@ main (argc, argv)
   scanner_fp scanner = NULL;
 
   /* Set program name for messages.  */
-  program_name = argv[0];
+  set_program_name (argv[0]);
   error_print_progname = maybe_print_progname;
 
 #ifdef HAVE_SETLOCALE