2001-12-19 Pavel Jan\e,Bm\e(Bk <Pavel@Janik.cz>
+ * 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 <eliz@is.elta.co.il>
#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
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;
}
*q++ = 0;
-
return copy;
}
}
-
\f
#if !defined (HAVE_SOCKETS) && !defined (HAVE_SYSVIPC)
if (argc - optind < 1)
print_help_and_exit ();
- /*
+ /*
* Open up an AF_UNIX socket in this person's home directory
*/
perror ("socket");
fail (argc, argv);
}
-
+
server.sun_family = AF_UNIX;
{
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);
}
}
}
-
+
switch (sock_status)
{
case 1:
fail (argc, argv);
}
break;
-
+
case 2:
/* `stat' failed */
if (errno == ENOENT)
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;