]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Fix a gcc warning on mingw.
authorBruno Haible <bruno@clisp.org>
Sat, 27 Apr 2019 02:58:24 +0000 (04:58 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 27 Apr 2019 02:58:24 +0000 (04:58 +0200)
* gettext-tools/src/msginit.c (get_user_pwd): Don't define if HAVE_PWD_H is not
set.
(get_user_fullname): Don't call get_user_pwd if HAVE_PWD_H is not set.

gettext-tools/src/msginit.c

index f17d01e84e5c15419538c131db1be2cfabbdfa84..0098bc74af3f84e9cd2cb56f8acff6ba3853e6d1 100644 (file)
@@ -1020,11 +1020,12 @@ po_revision_date (const char *header)
 }
 
 
+#if HAVE_PWD_H  /* Only Unix, not native Windows.  */
+
 /* Returns the struct passwd entry for the current user.  */
 static struct passwd *
 get_user_pwd ()
 {
-#if HAVE_PWD_H  /* Only Unix, not native Woe32.  */
   const char *username;
   struct passwd *userpasswd;
 
@@ -1059,20 +1060,21 @@ get_user_pwd ()
     return userpasswd;
   if (errno != 0)
     error (EXIT_FAILURE, errno, "getpwuid(%ju)", (uintmax_t) getuid ());
-#endif
 
   return NULL;
 }
 
+#endif
+
 
 /* Return the user's full name.  */
 static const char *
 get_user_fullname ()
 {
+#if HAVE_PWD_H
   struct passwd *pwd;
 
   pwd = get_user_pwd ();
-#if HAVE_PWD_H
   if (pwd != NULL)
     {
       const char *fullname;