aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorStefan Monnier2007-09-20 21:14:08 +0000
committerStefan Monnier2007-09-20 21:14:08 +0000
commitcb06b8dcb5358609794bf580ffd67539419c83a5 (patch)
tree3b4177f38f66d5658cbf7771f88e8f771db91d6b /lib-src
parent7f821b793827f75f08becb06ce90b3e8a5e9d4fe (diff)
downloademacs-cb06b8dcb5358609794bf580ffd67539419c83a5.tar.gz
emacs-cb06b8dcb5358609794bf580ffd67539419c83a5.zip
(DIRECTORY_SEP, IS_DIRECTORY_SEP, IS_DEVICE_SEP)
(IS_ANY_SEP): Only define if !defined(HAVE_GET_CURRENT_DIR_NAME). (main_argc): Remove. (strprefix): Use strncmp.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/ChangeLog7
-rw-r--r--lib-src/emacsclient.c59
2 files changed, 29 insertions, 37 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index b76c85d4b19..9bb80585f47 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,10 @@
12007-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * emacsclient.c (DIRECTORY_SEP, IS_DIRECTORY_SEP, IS_DEVICE_SEP)
4 (IS_ANY_SEP): Only define if !defined(HAVE_GET_CURRENT_DIR_NAME).
5 (main_argc): Remove.
6 (strprefix): Use strncmp.
7
12007-09-20 Jason Rumney <jasonr@gnu.org> 82007-09-20 Jason Rumney <jasonr@gnu.org>
2 9
3 * emacsclient.c (main) [SIGSTOP]: Change conditional from WINDOWSNT. 10 * emacsclient.c (main) [SIGSTOP]: Change conditional from WINDOWSNT.
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index 3b16b15f94a..4788c010bf8 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -81,25 +81,6 @@ Boston, MA 02110-1301, USA. */
81#include <signal.h> 81#include <signal.h>
82#include <errno.h> 82#include <errno.h>
83 83
84/* From lisp.h */
85#ifndef DIRECTORY_SEP
86#define DIRECTORY_SEP '/'
87#endif
88#ifndef IS_DIRECTORY_SEP
89#define IS_DIRECTORY_SEP(_c_) ((_c_) == DIRECTORY_SEP)
90#endif
91#ifndef IS_DEVICE_SEP
92#ifndef DEVICE_SEP
93#define IS_DEVICE_SEP(_c_) 0
94#else
95#define IS_DEVICE_SEP(_c_) ((_c_) == DEVICE_SEP)
96#endif
97#endif
98#ifndef IS_ANY_SEP
99#define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_))
100#endif
101
102
103 84
104char *getenv (), *getwd (); 85char *getenv (), *getwd ();
105char *(getcwd) (); 86char *(getcwd) ();
@@ -132,9 +113,6 @@ char *(getcwd) ();
132/* Name used to invoke this program. */ 113/* Name used to invoke this program. */
133char *progname; 114char *progname;
134 115
135/* The first argument to main. */
136int main_argc;
137
138/* The second argument to main. */ 116/* The second argument to main. */
139char **main_argv; 117char **main_argv;
140 118
@@ -221,6 +199,25 @@ xstrdup (const char *s)
221/* From sysdep.c */ 199/* From sysdep.c */
222#if !defined (HAVE_GET_CURRENT_DIR_NAME) || defined (BROKEN_GET_CURRENT_DIR_NAME) 200#if !defined (HAVE_GET_CURRENT_DIR_NAME) || defined (BROKEN_GET_CURRENT_DIR_NAME)
223 201
202/* From lisp.h */
203#ifndef DIRECTORY_SEP
204#define DIRECTORY_SEP '/'
205#endif
206#ifndef IS_DIRECTORY_SEP
207#define IS_DIRECTORY_SEP(_c_) ((_c_) == DIRECTORY_SEP)
208#endif
209#ifndef IS_DEVICE_SEP
210#ifndef DEVICE_SEP
211#define IS_DEVICE_SEP(_c_) 0
212#else
213#define IS_DEVICE_SEP(_c_) ((_c_) == DEVICE_SEP)
214#endif
215#endif
216#ifndef IS_ANY_SEP
217#define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_))
218#endif
219
220
224/* Return the current working directory. Returns NULL on errors. 221/* Return the current working directory. Returns NULL on errors.
225 Any other returned value must be freed with free. This is used 222 Any other returned value must be freed with free. This is used
226 only when get_current_dir_name is not defined on the system. */ 223 only when get_current_dir_name is not defined on the system. */
@@ -311,7 +308,7 @@ w32_window_app ()
311} 308}
312 309
313/* 310/*
314 execvp wrapper for Windows. Quotes arguments with embedded spaces. 311 execvp wrapper for Windows. Quotes arguments with embedded spaces.
315 312
316 This is necessary due to the broken implementation of exec* routines in 313 This is necessary due to the broken implementation of exec* routines in
317 the Microsoft libraries: they concatenate the arguments together without 314 the Microsoft libraries: they concatenate the arguments together without
@@ -516,6 +513,7 @@ Report bugs to bug-gnu-emacs@gnu.org.\n", progname);
516/* 513/*
517 Try to run a different command, or --if no alternate editor is 514 Try to run a different command, or --if no alternate editor is
518 defined-- exit with an errorcode. 515 defined-- exit with an errorcode.
516 Uses argv, but gets it from the global variable main_argv.
519*/ 517*/
520void 518void
521fail (void) 519fail (void)
@@ -539,7 +537,6 @@ main (argc, argv)
539 int argc; 537 int argc;
540 char **argv; 538 char **argv;
541{ 539{
542 main_argc = argc;
543 main_argv = argv; 540 main_argv = argv;
544 progname = argv[0]; 541 progname = argv[0];
545 message (TRUE, "%s: Sorry, the Emacs server is supported only\n" 542 message (TRUE, "%s: Sorry, the Emacs server is supported only\n"
@@ -893,17 +890,7 @@ set_tcp_socket ()
893static int 890static int
894strprefix (char *prefix, char *string) 891strprefix (char *prefix, char *string)
895{ 892{
896 int i; 893 return !strncmp (prefix, string, strlen (prefix));
897 if (! prefix)
898 return 1;
899
900 if (!string)
901 return 0;
902
903 for (i = 0; prefix[i]; i++)
904 if (!string[i] || string[i] != prefix[i])
905 return 0;
906 return 1;
907} 894}
908 895
909 896
@@ -1038,7 +1025,6 @@ set_local_socket ()
1038 int sock_status = 0; 1025 int sock_status = 0;
1039 int default_sock = !socket_name; 1026 int default_sock = !socket_name;
1040 int saved_errno = 0; 1027 int saved_errno = 0;
1041
1042 char *server_name = "server"; 1028 char *server_name = "server";
1043 1029
1044 if (socket_name && !index (socket_name, '/') && !index (socket_name, '\\')) 1030 if (socket_name && !index (socket_name, '/') && !index (socket_name, '\\'))
@@ -1268,7 +1254,6 @@ main (argc, argv)
1268 char *cwd, *str; 1254 char *cwd, *str;
1269 char string[BUFSIZ+1]; 1255 char string[BUFSIZ+1];
1270 1256
1271 main_argc = argc;
1272 main_argv = argv; 1257 main_argv = argv;
1273 progname = argv[0]; 1258 progname = argv[0];
1274 1259