* lisp.h (get_system_name): Remove prototype.
* xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
(get_environ_db): Use Vsystem_name. Avoid call to strlen.
+2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * editfns.c (get_system_name): Remove.
+ * lisp.h (get_system_name): Remove prototype.
+ * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
+ (get_environ_db): Use Vsystem_name. Avoid call to strlen.
+
2012-10-15 Daniel Colascione <dancol@dancol.org>
* dbusbind.c: Add comment explaining reason for previous change.
return Vsystem_name;
}
-const char *
-get_system_name (void)
-{
- if (STRINGP (Vsystem_name))
- return SSDATA (Vsystem_name);
- else
- return "";
-}
-
DEFUN ("emacs-pid", Femacs_pid, Semacs_pid, 0, 0, 0,
doc: /* Return the process ID of Emacs, as a number. */)
(void)
extern Lisp_Object make_buffer_string_both (ptrdiff_t, ptrdiff_t, ptrdiff_t,
ptrdiff_t, bool);
extern void init_editfns (void);
-const char *get_system_name (void);
extern void syms_of_editfns (void);
extern void set_time_zone_rule (const char *);
#include <unistd.h>
#include <errno.h>
#include <epaths.h>
-
+#include <stdlib.h>
#include <stdio.h>
#include "lisp.h"
#include "keyboard.h"
#endif
-extern char *getenv (const char *);
-
-extern struct passwd *getpwuid (uid_t);
-extern struct passwd *getpwnam (const char *);
-
char *x_get_string_resource (XrmDatabase rdb, const char *name,
const char *class);
static int file_p (const char *filename);
{
static char const xdefaults[] = ".Xdefaults-";
char *home = gethomedir ();
- char const *host = get_system_name ();
- ptrdiff_t pathsize = strlen (home) + sizeof xdefaults + strlen (host);
+ char const *host = SSDATA (Vsystem_name);
+ ptrdiff_t pathsize = (strlen (home) + sizeof xdefaults
+ + SBYTES (Vsystem_name));
path = xrealloc (home, pathsize);
strcat (strcat (path, xdefaults), host);
p = path;