aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDmitry Antipov2012-10-16 06:22:25 +0400
committerDmitry Antipov2012-10-16 06:22:25 +0400
commit61655b89f454597079c7f1ddf680d654c2c5f4e8 (patch)
tree8f3bcfdf8e2298d6a606ecf57269e1a063198252 /src
parent293902c8b28955cce23d0ae79820d363ba99bf72 (diff)
downloademacs-61655b89f454597079c7f1ddf680d654c2c5f4e8.tar.gz
emacs-61655b89f454597079c7f1ddf680d654c2c5f4e8.zip
* 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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/editfns.c9
-rw-r--r--src/lisp.h1
-rw-r--r--src/xrdb.c12
4 files changed, 11 insertions, 18 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 398eda841fe..26bd1925a5f 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
12012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
2
3 * editfns.c (get_system_name): Remove.
4 * lisp.h (get_system_name): Remove prototype.
5 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
6 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
7
12012-10-15 Daniel Colascione <dancol@dancol.org> 82012-10-15 Daniel Colascione <dancol@dancol.org>
2 9
3 * dbusbind.c: Add comment explaining reason for previous change. 10 * dbusbind.c: Add comment explaining reason for previous change.
diff --git a/src/editfns.c b/src/editfns.c
index 19fad7130a7..c5d4ed295ab 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -1339,15 +1339,6 @@ DEFUN ("system-name", Fsystem_name, Ssystem_name, 0, 0, 0,
1339 return Vsystem_name; 1339 return Vsystem_name;
1340} 1340}
1341 1341
1342const char *
1343get_system_name (void)
1344{
1345 if (STRINGP (Vsystem_name))
1346 return SSDATA (Vsystem_name);
1347 else
1348 return "";
1349}
1350
1351DEFUN ("emacs-pid", Femacs_pid, Semacs_pid, 0, 0, 0, 1342DEFUN ("emacs-pid", Femacs_pid, Semacs_pid, 0, 0, 0,
1352 doc: /* Return the process ID of Emacs, as a number. */) 1343 doc: /* Return the process ID of Emacs, as a number. */)
1353 (void) 1344 (void)
diff --git a/src/lisp.h b/src/lisp.h
index 7afe7b373fe..01f6ca5e57c 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -3127,7 +3127,6 @@ extern Lisp_Object make_buffer_string (ptrdiff_t, ptrdiff_t, bool);
3127extern Lisp_Object make_buffer_string_both (ptrdiff_t, ptrdiff_t, ptrdiff_t, 3127extern Lisp_Object make_buffer_string_both (ptrdiff_t, ptrdiff_t, ptrdiff_t,
3128 ptrdiff_t, bool); 3128 ptrdiff_t, bool);
3129extern void init_editfns (void); 3129extern void init_editfns (void);
3130const char *get_system_name (void);
3131extern void syms_of_editfns (void); 3130extern void syms_of_editfns (void);
3132extern void set_time_zone_rule (const char *); 3131extern void set_time_zone_rule (const char *);
3133 3132
diff --git a/src/xrdb.c b/src/xrdb.c
index 73672c9617c..9d056a607e4 100644
--- a/src/xrdb.c
+++ b/src/xrdb.c
@@ -24,7 +24,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
24#include <unistd.h> 24#include <unistd.h>
25#include <errno.h> 25#include <errno.h>
26#include <epaths.h> 26#include <epaths.h>
27 27#include <stdlib.h>
28#include <stdio.h> 28#include <stdio.h>
29 29
30#include "lisp.h" 30#include "lisp.h"
@@ -48,11 +48,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
48#include "keyboard.h" 48#include "keyboard.h"
49#endif 49#endif
50 50
51extern char *getenv (const char *);
52
53extern struct passwd *getpwuid (uid_t);
54extern struct passwd *getpwnam (const char *);
55
56char *x_get_string_resource (XrmDatabase rdb, const char *name, 51char *x_get_string_resource (XrmDatabase rdb, const char *name,
57 const char *class); 52 const char *class);
58static int file_p (const char *filename); 53static int file_p (const char *filename);
@@ -429,8 +424,9 @@ get_environ_db (void)
429 { 424 {
430 static char const xdefaults[] = ".Xdefaults-"; 425 static char const xdefaults[] = ".Xdefaults-";
431 char *home = gethomedir (); 426 char *home = gethomedir ();
432 char const *host = get_system_name (); 427 char const *host = SSDATA (Vsystem_name);
433 ptrdiff_t pathsize = strlen (home) + sizeof xdefaults + strlen (host); 428 ptrdiff_t pathsize = (strlen (home) + sizeof xdefaults
429 + SBYTES (Vsystem_name));
434 path = xrealloc (home, pathsize); 430 path = xrealloc (home, pathsize);
435 strcat (strcat (path, xdefaults), host); 431 strcat (strcat (path, xdefaults), host);
436 p = path; 432 p = path;