summaryrefslogtreecommitdiff
path: root/src/xrdb.c
diff options
context:
space:
mode:
authorKarl Heuer <kwzh@gnu.org>1994-02-02 06:26:21 +0000
committerKarl Heuer <kwzh@gnu.org>1994-02-02 06:26:21 +0000
commit123e4ba339aadf38912be25af2d21abc2b664c72 (patch)
tree86f0c6cdad141b0241ad89dc729515dc3d5028b4 /src/xrdb.c
parentc257302cfee08136b138af87de4b859910fa27c7 (diff)
downloademacs-123e4ba339aadf38912be25af2d21abc2b664c72.tar.gz
(x_get_customization_string): Use get_system_name instead of gethostname.
Diffstat (limited to 'src/xrdb.c')
-rw-r--r--src/xrdb.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/src/xrdb.c b/src/xrdb.c
index d3f22c91610..112badf3629 100644
--- a/src/xrdb.c
+++ b/src/xrdb.c
@@ -77,6 +77,8 @@ extern struct passwd *getpwuid ();
extern struct passwd *getpwnam ();
#endif
+extern char *get_system_name ();
+
/* Make sure not to #include anything after these definitions. Let's
not step on anyone's prototypes. */
#ifdef emacs
@@ -481,26 +483,12 @@ get_environ_db ()
{
XrmDatabase db;
char *p;
- char *path = 0, *home = 0, *host = 0;
+ char *path = 0, *home = 0, *host;
if ((p = getenv ("XENVIRONMENT")) == NULL)
{
home = gethomedir ();
-
- {
- int host_size = 100;
- host = (char *) malloc (host_size);
-
- for (;;)
- {
- host[host_size - 1] = '\0';
- gethostname (host, host_size - 1);
- if (strlen (host) < host_size - 1)
- break;
- host = (char *) realloc (host, host_size *= 2);
- }
- }
-
+ host = get_system_name ();
path = (char *) malloc (strlen (home)
+ sizeof (".Xdefaults-")
+ strlen (host));
@@ -512,7 +500,6 @@ get_environ_db ()
if (path) free (path);
if (home) free (home);
- if (host) free (host);
return db;
}