openbsd-ports/editors/xemacs21/patches/patch-src_editfns_c
naddy d7789b50e4 - upgrade to xemacs-21.1.14
- support for wnn and canna added
- better handling of the ncurses problem

Submitted by Jean-Yves Burlett <jean-yves@burlett.org>.
2001-03-01 21:20:15 +00:00

34 lines
891 B
Plaintext

$OpenBSD: patch-src_editfns_c,v 1.1 2001/03/01 21:20:17 naddy Exp $
--- src/editfns.c.orig Mon Feb 5 17:11:04 2001
+++ src/editfns.c Mon Feb 5 17:36:51 2001
@@ -871,6 +871,7 @@ char *
get_home_directory (void)
{
int output_home_warning = 0;
+ struct passwd *pw = NULL;
if (cached_home_directory == NULL)
{
@@ -912,6 +913,13 @@ get_home_directory (void)
# endif
}
#else /* !WINDOWSNT */
+ if ((pw = getpwuid(getuid())) != NULL)
+ {
+ cached_home_directory = pw->pw_dir;
+ output_home_warning = 0;
+ }
+ else
+ {
/*
* Unix, typically.
* Using "/" isn't quite right, but what should we do?
@@ -920,6 +928,7 @@ get_home_directory (void)
*/
cached_home_directory = "/";
output_home_warning = 1;
+ }
#endif /* !WINDOWSNT */
}
if (initialized && output_home_warning)