mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-31 20:02:42 +00:00
* emacsclient.c (s): Restore.
(main): Don't define s here. (w32_execvp): Move definition before use.
This commit is contained in:
parent
fa7a701fe3
commit
105faa8427
@ -1,3 +1,9 @@
|
|||||||
|
2007-05-16 Dan Nicolaescu <dann@ics.uci.edu>
|
||||||
|
|
||||||
|
* emacsclient.c (s): Restore.
|
||||||
|
(main): Don't define s here.
|
||||||
|
(w32_execvp): Move definition before use.
|
||||||
|
|
||||||
2007-05-16 Jason Rumney <jasonr@gnu.org>
|
2007-05-16 Jason Rumney <jasonr@gnu.org>
|
||||||
|
|
||||||
* emacsclient.c (s): Remove.
|
* emacsclient.c (s): Remove.
|
||||||
|
@ -172,7 +172,7 @@ char *server_file = NULL;
|
|||||||
int emacs_pid = 0;
|
int emacs_pid = 0;
|
||||||
|
|
||||||
/* Socket used to communicate with the Emacs server process. */
|
/* Socket used to communicate with the Emacs server process. */
|
||||||
/*HSOCKET s;*/
|
HSOCKET s;
|
||||||
|
|
||||||
void print_help_and_exit () NO_RETURN;
|
void print_help_and_exit () NO_RETURN;
|
||||||
|
|
||||||
@ -314,7 +314,41 @@ w32_window_app ()
|
|||||||
|
|
||||||
return window_app;
|
return window_app;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
/*
|
||||||
|
execvp wrapper for Windows. Quotes arguments with embedded spaces.
|
||||||
|
|
||||||
|
This is necessary due to the broken implementation of exec* routines in
|
||||||
|
the Microsoft libraries: they concatenate the arguments together without
|
||||||
|
quoting special characters, and pass the result to CreateProcess, with
|
||||||
|
predictably bad results. By contrast, Posix execvp passes the arguments
|
||||||
|
directly into the argv array of the child process.
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
w32_execvp (path, argv)
|
||||||
|
char *path;
|
||||||
|
char **argv;
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
/* Required to allow a .BAT script as alternate editor. */
|
||||||
|
argv[0] = (char *) alternate_editor;
|
||||||
|
|
||||||
|
for (i = 0; argv[i]; i++)
|
||||||
|
if (strchr (argv[i], ' '))
|
||||||
|
{
|
||||||
|
char *quoted = alloca (strlen (argv[i]) + 3);
|
||||||
|
sprintf (quoted, "\"%s\"", argv[i]);
|
||||||
|
argv[i] = quoted;
|
||||||
|
}
|
||||||
|
|
||||||
|
return execvp (path, argv);
|
||||||
|
}
|
||||||
|
|
||||||
|
#undef execvp
|
||||||
|
#define execvp w32_execvp
|
||||||
|
|
||||||
|
#endif /* WINDOWSNT */
|
||||||
|
|
||||||
void
|
void
|
||||||
message (int is_error, char *message, ...)
|
message (int is_error, char *message, ...)
|
||||||
@ -736,43 +770,6 @@ initialize_sockets ()
|
|||||||
#endif /* WINDOWSNT */
|
#endif /* WINDOWSNT */
|
||||||
|
|
||||||
|
|
||||||
#ifdef WINDOWSNT
|
|
||||||
|
|
||||||
/*
|
|
||||||
execvp wrapper for Windows. Quotes arguments with embedded spaces.
|
|
||||||
|
|
||||||
This is necessary due to the broken implementation of exec* routines in
|
|
||||||
the Microsoft libraries: they concatenate the arguments together without
|
|
||||||
quoting special characters, and pass the result to CreateProcess, with
|
|
||||||
predictably bad results. By contrast, Posix execvp passes the arguments
|
|
||||||
directly into the argv array of the child process.
|
|
||||||
*/
|
|
||||||
int
|
|
||||||
w32_execvp (path, argv)
|
|
||||||
char *path;
|
|
||||||
char **argv;
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
/* Required to allow a .BAT script as alternate editor. */
|
|
||||||
argv[0] = (char *) alternate_editor;
|
|
||||||
|
|
||||||
for (i = 0; argv[i]; i++)
|
|
||||||
if (strchr (argv[i], ' '))
|
|
||||||
{
|
|
||||||
char *quoted = alloca (strlen (argv[i]) + 3);
|
|
||||||
sprintf (quoted, "\"%s\"", argv[i]);
|
|
||||||
argv[i] = quoted;
|
|
||||||
}
|
|
||||||
|
|
||||||
return execvp (path, argv);
|
|
||||||
}
|
|
||||||
|
|
||||||
#undef execvp
|
|
||||||
#define execvp w32_execvp
|
|
||||||
|
|
||||||
#endif /* WINDOWSNT */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Read the information needed to set up a TCP comm channel with
|
* Read the information needed to set up a TCP comm channel with
|
||||||
* the Emacs server: host, port, pid and authentication string.
|
* the Emacs server: host, port, pid and authentication string.
|
||||||
@ -1265,7 +1262,6 @@ main (argc, argv)
|
|||||||
int argc;
|
int argc;
|
||||||
char **argv;
|
char **argv;
|
||||||
{
|
{
|
||||||
HSOCKET s;
|
|
||||||
int i, rl, needlf = 0;
|
int i, rl, needlf = 0;
|
||||||
char *cwd, *str;
|
char *cwd, *str;
|
||||||
char string[BUFSIZ+1];
|
char string[BUFSIZ+1];
|
||||||
|
Loading…
Reference in New Issue
Block a user