]> git.eshelyaron.com Git - emacs.git/commitdiff
(x_get_customization_string): Use get_system_name instead of gethostname.
authorKarl Heuer <kwzh@gnu.org>
Wed, 2 Feb 1994 06:26:21 +0000 (06:26 +0000)
committerKarl Heuer <kwzh@gnu.org>
Wed, 2 Feb 1994 06:26:21 +0000 (06:26 +0000)
src/xrdb.c

index d3f22c91610c834ac668a155baf096b84876a216..112badf3629e0bf5c18f1ffe6f1078c46ac08a22 100644 (file)
@@ -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;
 }