diff options
| author | Dmitry Antipov | 2012-10-16 06:22:25 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2012-10-16 06:22:25 +0400 |
| commit | 61655b89f454597079c7f1ddf680d654c2c5f4e8 (patch) | |
| tree | 8f3bcfdf8e2298d6a606ecf57269e1a063198252 | |
| parent | 293902c8b28955cce23d0ae79820d363ba99bf72 (diff) | |
| download | emacs-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.
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/editfns.c | 9 | ||||
| -rw-r--r-- | src/lisp.h | 1 | ||||
| -rw-r--r-- | src/xrdb.c | 12 |
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 @@ | |||
| 1 | 2012-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 | |||
| 1 | 2012-10-15 Daniel Colascione <dancol@dancol.org> | 8 | 2012-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 | ||
| 1342 | const char * | ||
| 1343 | get_system_name (void) | ||
| 1344 | { | ||
| 1345 | if (STRINGP (Vsystem_name)) | ||
| 1346 | return SSDATA (Vsystem_name); | ||
| 1347 | else | ||
| 1348 | return ""; | ||
| 1349 | } | ||
| 1350 | |||
| 1351 | DEFUN ("emacs-pid", Femacs_pid, Semacs_pid, 0, 0, 0, | 1342 | DEFUN ("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); | |||
| 3127 | extern Lisp_Object make_buffer_string_both (ptrdiff_t, ptrdiff_t, ptrdiff_t, | 3127 | extern Lisp_Object make_buffer_string_both (ptrdiff_t, ptrdiff_t, ptrdiff_t, |
| 3128 | ptrdiff_t, bool); | 3128 | ptrdiff_t, bool); |
| 3129 | extern void init_editfns (void); | 3129 | extern void init_editfns (void); |
| 3130 | const char *get_system_name (void); | ||
| 3131 | extern void syms_of_editfns (void); | 3130 | extern void syms_of_editfns (void); |
| 3132 | extern void set_time_zone_rule (const char *); | 3131 | extern 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 | ||
| 51 | extern char *getenv (const char *); | ||
| 52 | |||
| 53 | extern struct passwd *getpwuid (uid_t); | ||
| 54 | extern struct passwd *getpwnam (const char *); | ||
| 55 | |||
| 56 | char *x_get_string_resource (XrmDatabase rdb, const char *name, | 51 | char *x_get_string_resource (XrmDatabase rdb, const char *name, |
| 57 | const char *class); | 52 | const char *class); |
| 58 | static int file_p (const char *filename); | 53 | static 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; |