shishi-commit
[Top][All Lists]
Advanced

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

CVS shishi/lib


From: shishi-commit
Subject: CVS shishi/lib
Date: Tue, 7 Feb 2006 13:34:11 +0100

Update of /home/cvs/shishi/lib
In directory dopio:/tmp/cvs-serv26549

Modified Files:
        principal.c 
Log Message:
Fix getpwuid call, for mingw32.


--- /home/cvs/shishi/lib/principal.c    2005/05/26 15:12:35     1.42
+++ /home/cvs/shishi/lib/principal.c    2006/02/07 12:34:11     1.43
@@ -1,5 +1,5 @@
 /* principal.c --- Get and set default principal.
- * Copyright (C) 2002, 2003, 2004  Simon Josefsson
+ * Copyright (C) 2002, 2003, 2004, 2006  Simon Josefsson
  *
  * This file is part of Shishi.
  *
@@ -33,15 +33,17 @@
 char *
 shishi_principal_default_guess (void)
 {
+#if HAVE_GETPWUID
   uid_t uid;
   struct passwd *pw;
 
   uid = getuid ();
   pw = getpwuid (uid);
 
-  if (pw)
+  if (pw && pw->pw_name)
     return xstrdup (pw->pw_name);
   else
+#endif
     return xstrdup ("user");
 }
 





reply via email to

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