#include <stdio.h>
@@ -976,6 +979,12 @@
"will be started. Options that start with a plus sign (+) restore the default.",
NULL};
+static int abbrev (char *tst, char *cmp)
+{
+ size_t len = strlen(tst);
+ return ((len >= 2) && (!strncmp(tst, cmp, len)));
+}
+
static void Syntax (badOption)
char *badOption;
{
@@ -1115,9 +1124,9 @@
/* Do these first, since we may not be able to open the display */
ProgramName = argv[0];
if (argc > 1) {
- if (!strncmp(argv[1], "-v", 2))
+ if (abbrev(argv[1], "-version"))
Version();
- if (!strncmp(argv[1], "-h", 2) && strncmp(argv[1], "-hc", 3))
+ if (abbrev(argv[1], "-help"))
Help();
}
#ifndef X_NOT_POSIX
+#ifndef linux
#define HAS_WAITPID
#endif
+#endif
/*
* create a file only if we could with the permissions of the real user id.
@@ -559,18 +561,10 @@
int pid;
#ifndef HAS_WAITPID
int waited;
- int (*chldfunc)();
+ SIGNAL_T (*chldfunc)();
@@ -518,6 +518,12 @@
"will be started. Options that start with a plus sign (+) restore the default.",
NULL};
+static int abbrev (char *tst, char *cmp)
+{
+ size_t len = strlen(tst);
+ return ((len >= 2) && (!strncmp(tst, cmp, len)));
+}
+
static void Syntax (badOption)
char *badOption;
{
@@ -770,9 +776,9 @@
/* Do these first, since we may not be able to open the display */
ProgramName = argv[0];
if (argc > 1) {
- if (!strncmp(argv[1], "-v", 2))
+ if (abbrev(argv[1], "-version"))
Version();
- if (!strncmp(argv[1], "-h", 2) && strncmp(argv[1], "-hc", 3))
+ if (abbrev(argv[1], "-help"))
Help();
}
#define Strlen(a) strlen((char *)a)
@@ -172,8 +173,33 @@
{
static int initialized;
if (!initialized) {
+ FILE *input;
+ int my_pipe[2];
+ int my_pid;
+ int c;
register TScreen *screen = &term->screen;
- Printer = popen(screen->printer_command, "w");
+
+ if (pipe(my_pipe))
+ SysError (ERROR_FORK);
+ if ((my_pid = fork()) < 0)
+ SysError (ERROR_FORK);
+
+ if (my_pid == 0) {
+ close(my_pipe[1]); /* printer is silent */
+ setgid (screen->gid);
+ setuid (screen->uid);
+ Printer = popen(screen->printer_command, "w");
+ input = fdopen(my_pipe[0], "r");
+ while ((c = fgetc(input)) != EOF) {
+ fputc(c, Printer);
+ if (chr == '\r' || chr == '\n' || chr == '\f')
+ fflush(Printer);
+ }
+ exit(0);
+ } else {
+ close(my_pipe[0]); /* won't read from printer */
+ Printer = fdopen(my_pipe[1], "w");
+ }
initialized++;
}
if (Printer != 0) {
Index: X11/xc/programs/xterm/ptyx.h
diff -u X11/xc/programs/xterm/ptyx.h:1.2 X11/xc/programs/xterm/ptyx.h:1.3
--- X11/xc/programs/xterm/ptyx.h:1.2 Sat Mar 14 13:35:31 1998
+++ X11/xc/programs/xterm/ptyx.h Sun May 3 01:38:07 1998
@@ -529,10 +529,6 @@
#define DoSM(code,value) screen->save_modes[code] = value
#define DoRM(code,value) value = screen->save_modes[code]
-#if defined(SVR4) || defined(linux) || defined(CSRG_BASED)
-#define HAS_SAVED_IDS_AND_SETEUID
-#endif
-
typedef struct {
Boolean saved;
int row;
@@ -561,10 +557,6 @@
long pid; /* pid of process on far side */
int uid; /* user id of actual person */
int gid; /* group id of actual person */
-#ifdef HAS_SAVED_IDS_AND_SETEUID
- int euid;
- int egid;
-#endif
GC cursorGC; /* normal cursor painting */
GC fillCursorGC; /* special cursor painting */
GC reversecursorGC;/* reverse cursor painting */
Index: X11/xc/programs/xterm/version.h
diff -u X11/xc/programs/xterm/version.h:1.1.1.1 X11/xc/programs/xterm/version.h:1.2
--- X11/xc/programs/xterm/version.h:1.1.1.1 Sat Mar 7 09:26:09 1998
+++ X11/xc/programs/xterm/version.h Sun May 3 01:38:08 1998
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/xterm/version.h,v 3.2.2.3 1998/03/03 12:51:03 dawes Exp $ */
+/* $XFree86: xc/programs/xterm/version.h,v 3.2.2.5 1998/04/29 04:18:47 dawes Exp $ */
/*
* This is the string that's printed in response to "xterm -version", or
@@ -6,4 +6,4 @@
* version of xterm has been built. The number in parentheses is my patch
* number (T.Dickey).
*/
-#define XTERM_VERSION "XFree86 3.9Ad(68)"
+#define XTERM_VERSION "XFree86 3.3.2.1"
Index: X11/xc/lib/Xaw/XawIm.c
diff -u X11/xc/lib/Xaw/XawIm.c:1.1.1.1 X11/xc/lib/Xaw/XawIm.c:1.2
--- X11/xc/lib/Xaw/XawIm.c:1.1.1.1 Fri Sep 5 02:59:50 1997
+++ X11/xc/lib/Xaw/XawIm.c Sun May 3 01:33:11 1998
@@ -53,6 +53,7 @@
in this Software without prior written authorization from the X Consortium.