Project Info Name.......: gnu-hello
Description: GNU Hello


gnu-hello       
Info
Commit...:c4aed004e3dc8457fa240e6a8ab90b257c8c1d2a
Author...:Reuben Thomas
Committer:Reuben Thomas
Date.....:Thu Dec 12 15:14:42 2013 +0000
Parents..:6acd585a8c208b3937cff76af88ed72c10a21f43

Message
Fix i18n of default message: don't initialise it before we set up gettext

Changes
diff --git a/src/hello.c b/src/hello.c
line changes: +5/-2
index b033a1d..9c27234
--- a/src/hello.c
+++ b/src/hello.c
@@ -1,7 +1,7 @@
 /* hello.c -- print a greeting message and exit.
 
    Copyright 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2005,
-   2006, 2007, 2008, 2010, 2011 Free Software Foundation, Inc.
+   2006, 2007, 2008, 2010, 2011, 2013 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -48,7 +48,7 @@ main (int argc, char *argv[])
 {
   int optc;
   int lose = 0;
-  const char *greeting_msg = _("Hello, world!");
+  const char *greeting_msg;
   wchar_t *mb_greeting;
   size_t len;
   greeting_type g = greet_traditional;
@@ -64,6 +64,9 @@ main (int argc, char *argv[])
   textdomain (PACKAGE);
 #endif
 
+  /* Having initialized gettext, get the default message. */
+  greeting_msg = _("Hello, world!");
+
   /* Even exiting has subtleties.  On exit, if any writes failed, change
      the exit status.  The /dev/full device on GNU/Linux can be used for
      testing; for instance, hello >/dev/full should exit unsuccessfully.

This website is licensed under AGPL-3.0. Feel free to copy!