64 |
{ "no-wait", no_argument, NULL, 'n' }, |
{ "no-wait", no_argument, NULL, 'n' }, |
65 |
{ "help", no_argument, NULL, 'H' }, |
{ "help", no_argument, NULL, 'H' }, |
66 |
{ "version", no_argument, NULL, 'V' }, |
{ "version", no_argument, NULL, 'V' }, |
67 |
{ "alternate-editor",required_argument, NULL, 'a' }, |
{ "alternate-editor", required_argument, NULL, 'a' }, |
68 |
{ 0 } |
{ 0 } |
69 |
}; |
}; |
70 |
|
|
131 |
} |
} |
132 |
|
|
133 |
/* Return a copy of NAME, inserting a & |
/* Return a copy of NAME, inserting a & |
134 |
before each &, each space, and any initial -. |
before each &, each space, each newline, and any initial -. |
135 |
Change spaces to underscores, too, so that the |
Change spaces to underscores, too, so that the |
136 |
return value never contains a space. */ |
return value never contains a space. */ |
137 |
|
|
152 |
*q++ = '_'; |
*q++ = '_'; |
153 |
p++; |
p++; |
154 |
} |
} |
155 |
|
else if (*p == '\n') |
156 |
|
{ |
157 |
|
*q++ = '&'; |
158 |
|
*q++ = 'n'; |
159 |
|
p++; |
160 |
|
} |
161 |
else |
else |
162 |
{ |
{ |
163 |
if (*p == '&' || (*p == '-' && p == name)) |
if (*p == '&' || (*p == '-' && p == name)) |
196 |
{ |
{ |
197 |
if (alternate_editor) |
if (alternate_editor) |
198 |
{ |
{ |
199 |
int i = optind -1 ; |
int i = optind - 1; |
200 |
execvp (alternate_editor, argv + i); |
execvp (alternate_editor, argv + i); |
201 |
return; |
return; |
202 |
} |
} |
263 |
{ |
{ |
264 |
char *system_name; |
char *system_name; |
265 |
int system_name_length; |
int system_name_length; |
266 |
int s, i; |
int s, i, needlf = 0; |
267 |
FILE *out, *in; |
FILE *out, *in; |
268 |
struct sockaddr_un server; |
struct sockaddr_un server; |
269 |
#ifdef SERVER_HOME_DIR |
#ifdef SERVER_HOME_DIR |
450 |
return 0; |
return 0; |
451 |
|
|
452 |
printf ("Waiting for Emacs..."); |
printf ("Waiting for Emacs..."); |
453 |
|
needlf = 2; |
454 |
fflush (stdout); |
fflush (stdout); |
455 |
|
|
456 |
/* Now, wait for an answer and print any messages. On some systems, |
/* Now, wait for an answer and print any messages. */ |
|
the first line we read will actually be the output we just sent. |
|
|
We can't predict whether that will happen, so if it does, we |
|
|
detect it by recognizing `Client: ' at the beginning. */ |
|
|
|
|
457 |
while ((str = fgets (string, BUFSIZ, in))) |
while ((str = fgets (string, BUFSIZ, in))) |
458 |
printf ("%s", str); |
{ |
459 |
|
if (needlf == 2) |
460 |
|
printf ("\n"); |
461 |
|
printf ("%s", str); |
462 |
|
needlf = str[0] == '\0' ? needlf : str[strlen (str) - 1] != '\n'; |
463 |
|
} |
464 |
|
|
465 |
|
if (needlf) |
466 |
|
printf ("\n"); |
467 |
|
fflush (stdout); |
468 |
|
|
469 |
return 0; |
return 0; |
470 |
} |
} |