diff options
| author | Pavel Janík | 2001-12-19 07:21:17 +0000 |
|---|---|---|
| committer | Pavel Janík | 2001-12-19 07:21:17 +0000 |
| commit | e69233c2de0e722fd9f7805ecf68a6279034de12 (patch) | |
| tree | e8ec2c145235630d74524a53c9ea76d960d140a1 /lib-src | |
| parent | 69bfc389e93e4167de96c719f7a6c1c7b9ff7b05 (diff) | |
| download | emacs-e69233c2de0e722fd9f7805ecf68a6279034de12.tar.gz emacs-e69233c2de0e722fd9f7805ecf68a6279034de12.zip | |
Include "config.h", not <../src/config.h>.
(main): Parenthesize assignment when used as truth value to
prevent gcc warnings.
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/ChangeLog | 4 | ||||
| -rw-r--r-- | lib-src/emacsclient.c | 32 |
2 files changed, 21 insertions, 15 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index a360389ecb3..33717725b5d 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog | |||
| @@ -1,5 +1,9 @@ | |||
| 1 | 2001-12-19 Pavel Jan,Bm(Bk <Pavel@Janik.cz> | 1 | 2001-12-19 Pavel Jan,Bm(Bk <Pavel@Janik.cz> |
| 2 | 2 | ||
| 3 | * emacsclient.c: Include "config.h", not <../src/config.h>. | ||
| 4 | (main): Parenthesize assignment when used as truth value to | ||
| 5 | prevent gcc warnings. | ||
| 6 | |||
| 3 | * ebrowse.c: Include stdlib.h and string.h conditionally. | 7 | * ebrowse.c: Include stdlib.h and string.h conditionally. |
| 4 | 8 | ||
| 5 | 2001-12-18 Eli Zaretskii <eliz@is.elta.co.il> | 9 | 2001-12-18 Eli Zaretskii <eliz@is.elta.co.il> |
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index 988bfc4fd4d..13d3e1fe7c9 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c | |||
| @@ -21,10 +21,14 @@ Boston, MA 02111-1307, USA. */ | |||
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | #define NO_SHORTNAMES | 23 | #define NO_SHORTNAMES |
| 24 | #include <../src/config.h> | 24 | |
| 25 | #ifdef HAVE_CONFIG_H | ||
| 26 | #include "config.h" | ||
| 27 | #endif | ||
| 28 | |||
| 25 | #undef signal | 29 | #undef signal |
| 26 | 30 | ||
| 27 | #include <ctype.h> | 31 | #include <ctype.h> |
| 28 | #include <stdio.h> | 32 | #include <stdio.h> |
| 29 | #include <getopt.h> | 33 | #include <getopt.h> |
| 30 | #ifdef HAVE_UNISTD_H | 34 | #ifdef HAVE_UNISTD_H |
| @@ -84,18 +88,18 @@ decode_options (argc, argv) | |||
| 84 | break; | 88 | break; |
| 85 | 89 | ||
| 86 | alternate_editor = getenv ("ALTERNATE_EDITOR"); | 90 | alternate_editor = getenv ("ALTERNATE_EDITOR"); |
| 87 | 91 | ||
| 88 | switch (opt) | 92 | switch (opt) |
| 89 | { | 93 | { |
| 90 | case 0: | 94 | case 0: |
| 91 | /* If getopt returns 0, then it has already processed a | 95 | /* If getopt returns 0, then it has already processed a |
| 92 | long-named option. We should do nothing. */ | 96 | long-named option. We should do nothing. */ |
| 93 | break; | 97 | break; |
| 94 | 98 | ||
| 95 | case 'a': | 99 | case 'a': |
| 96 | alternate_editor = optarg; | 100 | alternate_editor = optarg; |
| 97 | break; | 101 | break; |
| 98 | 102 | ||
| 99 | case 'n': | 103 | case 'n': |
| 100 | nowait = 1; | 104 | nowait = 1; |
| 101 | break; | 105 | break; |
| @@ -157,7 +161,6 @@ quote_file_name (name) | |||
| 157 | } | 161 | } |
| 158 | *q++ = 0; | 162 | *q++ = 0; |
| 159 | 163 | ||
| 160 | |||
| 161 | return copy; | 164 | return copy; |
| 162 | } | 165 | } |
| 163 | 166 | ||
| @@ -198,7 +201,6 @@ fail (argc, argv) | |||
| 198 | } | 201 | } |
| 199 | 202 | ||
| 200 | 203 | ||
| 201 | |||
| 202 | 204 | ||
| 203 | #if !defined (HAVE_SOCKETS) && !defined (HAVE_SYSVIPC) | 205 | #if !defined (HAVE_SOCKETS) && !defined (HAVE_SYSVIPC) |
| 204 | 206 | ||
| @@ -272,7 +274,7 @@ main (argc, argv) | |||
| 272 | if (argc - optind < 1) | 274 | if (argc - optind < 1) |
| 273 | print_help_and_exit (); | 275 | print_help_and_exit (); |
| 274 | 276 | ||
| 275 | /* | 277 | /* |
| 276 | * Open up an AF_UNIX socket in this person's home directory | 278 | * Open up an AF_UNIX socket in this person's home directory |
| 277 | */ | 279 | */ |
| 278 | 280 | ||
| @@ -282,7 +284,7 @@ main (argc, argv) | |||
| 282 | perror ("socket"); | 284 | perror ("socket"); |
| 283 | fail (argc, argv); | 285 | fail (argc, argv); |
| 284 | } | 286 | } |
| 285 | 287 | ||
| 286 | server.sun_family = AF_UNIX; | 288 | server.sun_family = AF_UNIX; |
| 287 | 289 | ||
| 288 | { | 290 | { |
| @@ -317,11 +319,11 @@ main (argc, argv) | |||
| 317 | our euid. If so, look for a socket based on the UID | 319 | our euid. If so, look for a socket based on the UID |
| 318 | associated with the name. This is reminiscent of the logic | 320 | associated with the name. This is reminiscent of the logic |
| 319 | that init_editfns uses to set the global Vuser_full_name. */ | 321 | that init_editfns uses to set the global Vuser_full_name. */ |
| 320 | 322 | ||
| 321 | char *user_name = (char *) getenv ("LOGNAME"); | 323 | char *user_name = (char *) getenv ("LOGNAME"); |
| 322 | if (!user_name) | 324 | if (!user_name) |
| 323 | user_name = (char *) getenv ("USER"); | 325 | user_name = (char *) getenv ("USER"); |
| 324 | 326 | ||
| 325 | if (user_name) | 327 | if (user_name) |
| 326 | { | 328 | { |
| 327 | struct passwd *pw = getpwnam (user_name); | 329 | struct passwd *pw = getpwnam (user_name); |
| @@ -334,7 +336,7 @@ main (argc, argv) | |||
| 334 | } | 336 | } |
| 335 | } | 337 | } |
| 336 | } | 338 | } |
| 337 | 339 | ||
| 338 | switch (sock_status) | 340 | switch (sock_status) |
| 339 | { | 341 | { |
| 340 | case 1: | 342 | case 1: |
| @@ -346,7 +348,7 @@ main (argc, argv) | |||
| 346 | fail (argc, argv); | 348 | fail (argc, argv); |
| 347 | } | 349 | } |
| 348 | break; | 350 | break; |
| 349 | 351 | ||
| 350 | case 2: | 352 | case 2: |
| 351 | /* `stat' failed */ | 353 | /* `stat' failed */ |
| 352 | if (errno == ENOENT) | 354 | if (errno == ENOENT) |
| @@ -448,8 +450,8 @@ main (argc, argv) | |||
| 448 | the first line we read will actually be the output we just sent. | 450 | the first line we read will actually be the output we just sent. |
| 449 | We can't predict whether that will happen, so if it does, we | 451 | We can't predict whether that will happen, so if it does, we |
| 450 | detect it by recognizing `Client: ' at the beginning. */ | 452 | detect it by recognizing `Client: ' at the beginning. */ |
| 451 | 453 | ||
| 452 | while (str = fgets (string, BUFSIZ, in)) | 454 | while ((str = fgets (string, BUFSIZ, in))) |
| 453 | printf ("%s", str); | 455 | printf ("%s", str); |
| 454 | 456 | ||
| 455 | return 0; | 457 | return 0; |