aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorPavel Janík <[email protected]>2001-12-19 07:21:17 +0000
committerPavel Janík <[email protected]>2001-12-19 07:21:17 +0000
commite69233c2de0e722fd9f7805ecf68a6279034de12 (patch)
treee8ec2c145235630d74524a53c9ea76d960d140a1 /lib-src
parent69bfc389e93e4167de96c719f7a6c1c7b9ff7b05 (diff)
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/ChangeLog4
-rw-r--r--lib-src/emacsclient.c32
2 files changed, 21 insertions, 15 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index a360389ecb..33717725b5 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,5 +1,9 @@
2001-12-19 Pavel Jan,Bm(Bk <[email protected]>
+ * emacsclient.c: Include "config.h", not <../src/config.h>.
+ (main): Parenthesize assignment when used as truth value to
+ prevent gcc warnings.
+
* ebrowse.c: Include stdlib.h and string.h conditionally.
2001-12-18 Eli Zaretskii <[email protected]>
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index 988bfc4fd4..13d3e1fe7c 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -21,10 +21,14 @@ Boston, MA 02111-1307, USA. */
#define NO_SHORTNAMES
-#include <../src/config.h>
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#undef signal
-#include <ctype.h>
+#include <ctype.h>
#include <stdio.h>
#include <getopt.h>
#ifdef HAVE_UNISTD_H
@@ -84,18 +88,18 @@ decode_options (argc, argv)
break;
alternate_editor = getenv ("ALTERNATE_EDITOR");
-
+
switch (opt)
{
case 0:
/* If getopt returns 0, then it has already processed a
long-named option. We should do nothing. */
break;
-
+
case 'a':
alternate_editor = optarg;
break;
-
+
case 'n':
nowait = 1;
break;
@@ -157,7 +161,6 @@ quote_file_name (name)
}
*q++ = 0;
-
return copy;
}
@@ -198,7 +201,6 @@ fail (argc, argv)
}
-
#if !defined (HAVE_SOCKETS) && !defined (HAVE_SYSVIPC)
@@ -272,7 +274,7 @@ main (argc, argv)
if (argc - optind < 1)
print_help_and_exit ();
- /*
+ /*
* Open up an AF_UNIX socket in this person's home directory
*/
@@ -282,7 +284,7 @@ main (argc, argv)
perror ("socket");
fail (argc, argv);
}
-
+
server.sun_family = AF_UNIX;
{
@@ -317,11 +319,11 @@ main (argc, argv)
our euid. If so, look for a socket based on the UID
associated with the name. This is reminiscent of the logic
that init_editfns uses to set the global Vuser_full_name. */
-
+
char *user_name = (char *) getenv ("LOGNAME");
if (!user_name)
user_name = (char *) getenv ("USER");
-
+
if (user_name)
{
struct passwd *pw = getpwnam (user_name);
@@ -334,7 +336,7 @@ main (argc, argv)
}
}
}
-
+
switch (sock_status)
{
case 1:
@@ -346,7 +348,7 @@ main (argc, argv)
fail (argc, argv);
}
break;
-
+
case 2:
/* `stat' failed */
if (errno == ENOENT)
@@ -448,8 +450,8 @@ main (argc, argv)
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. */
-
- while (str = fgets (string, BUFSIZ, in))
+
+ while ((str = fgets (string, BUFSIZ, in)))
printf ("%s", str);
return 0;