# HG changeset patch # User Karl Heuer # Date 760170381 0 # Node ID 87611653922f588e0ca6e6270beea16a8614c947 # Parent 3c8ae6c720d8ca98f05d4090ebdbfc72d6d4d53d (x_get_customization_string): Use get_system_name instead of gethostname. diff -r 3c8ae6c720d8 -r 87611653922f src/xrdb.c --- a/src/xrdb.c Wed Feb 02 06:20:58 1994 +0000 +++ b/src/xrdb.c Wed Feb 02 06:26:21 1994 +0000 @@ -77,6 +77,8 @@ 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 @@ { 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 @@ if (path) free (path); if (home) free (home); - if (host) free (host); return db; }