summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaleb Keithley <kaleb@freedesktop.org>2003-11-26 22:49:12 +0000
committerKaleb Keithley <kaleb@freedesktop.org>2003-11-26 22:49:12 +0000
commit4483ae693543d0e3e72766bc930f472c0957dbdf (patch)
tree2f4eab4ab9f497b783e4e0e7c8a8e1d2c3ae35d8
parent36fca7804971e1b209138fcf82aee2d74cb2583e (diff)
merge latest (4.3.99.16) from XFree86 (vendor) branchXORG-RELEASE-1-BASEXEVIE-MERGEXEVIE-BASEXINERAMA_2XEVIE
-rw-r--r--ScrollByL.c9
-rw-r--r--handler.c7
-rw-r--r--man.c3
-rw-r--r--misc.c28
-rw-r--r--search.c6
-rw-r--r--vendor.h20
6 files changed, 35 insertions, 38 deletions
diff --git a/ScrollByL.c b/ScrollByL.c
index b312128..42d942d 100644
--- a/ScrollByL.c
+++ b/ScrollByL.c
@@ -28,7 +28,7 @@ other dealings in this Software without prior written authorization
from the X Consortium.
*/
-/* $XFree86: xc/programs/xman/ScrollByL.c,v 1.6 2001/10/28 03:34:36 tsi Exp $ */
+/* $XFree86: xc/programs/xman/ScrollByL.c,v 1.7 2003/05/27 22:27:07 tsi Exp $ */
#if !defined(lint) && !defined(SABER) && 0
static char rcs_version[] = "$Athena: ScrollByL.c,v 4.5 88/12/19 13:46:04 kit Exp $";
@@ -902,7 +902,6 @@ PrintText(Widget w, int start_line, int num_lines, int location)
register char *bufp, *c; /* Generic char pointers */
int current_line; /* the number of the currrent line */
char buf[BUFSIZ]; /* Misc. characters */
- int width; /* Width of a tab stop. */
Boolean italicflag = FALSE; /* Print text in italics?? */
Boolean first = TRUE; /* First line of a manual page??? */
int x_loc, y_loc; /* x and y location of text. */
@@ -914,12 +913,9 @@ PrintText(Widget w, int start_line, int num_lines, int location)
* lots is greater than two. Use a space width of 70% of the
* widest character in the font.
*/
- XFontStruct * h_font;
int h_col, h_fix;
char * h_c;
- h_font = sblw->scroll.normal_font;
-
/*
* Nothing loaded, take no action.
*/
@@ -933,9 +929,6 @@ PrintText(Widget w, int start_line, int num_lines, int location)
c = *(sblw->scroll.top_line + start_line);
- /* Width of a tab stop. */
- width = 8 * h_width;
-
/*
* Because XDrawString uses the bottom of the text as a position
* reference, add the height from the top of the font to the baseline
diff --git a/handler.c b/handler.c
index da1fd08..0f16c38 100644
--- a/handler.c
+++ b/handler.c
@@ -28,7 +28,7 @@ other dealings in this Software without prior written authorization
from the X Consortium.
*/
-/* $XFree86: xc/programs/xman/handler.c,v 1.6 2003/01/19 04:44:45 paulo Exp $ */
+/* $XFree86: xc/programs/xman/handler.c,v 1.7 2003/04/09 20:31:31 herrb Exp $ */
/*
* xman - X window system manual page display program.
@@ -215,6 +215,7 @@ DirectoryHandler(Widget w, XtPointer global_pointer, XtPointer ret_val)
file = FindManualFile(man_globals, man_globals->current_directory,
ret_struct->list_index);
PutUpManpage(man_globals, file);
+ fclose(file);
}
/* Function Name: DirPopupCallback
@@ -531,7 +532,7 @@ void
Search(Widget w, XEvent * event, String * params, Cardinal * num_params)
{
ManpageGlobals * man_globals = GetGlobals(w);
- FILE * file;
+ FILE * file = NULL;
XtPopdown( XtParent(XtParent(w)) ); /* popdown the search widget */
@@ -588,6 +589,8 @@ Search(Widget w, XEvent * event, String * params, Cardinal * num_params)
else {
PutUpManpage(man_globals, file);
}
+ if (file != NULL)
+ fclose(file);
}
/* Function Name: ShowVersion
diff --git a/man.c b/man.c
index 5b1627d..452425f 100644
--- a/man.c
+++ b/man.c
@@ -28,7 +28,7 @@ other dealings in this Software without prior written authorization
from the X Consortium.
*/
-/* $XFree86: xc/programs/xman/man.c,v 1.7 2002/08/05 01:47:34 torrey Exp $ */
+/* $XFree86: xc/programs/xman/man.c,v 1.8 2003/04/09 20:31:31 herrb Exp $ */
#include "globals.h"
@@ -1090,6 +1090,7 @@ ReadManConfig(char manpath[])
memset(&gs, 0, sizeof(glob_t));
while ((path = strtok((char *)NULL, " \t\n"))) {
if (glob(path, GLOB_BRACE, NULL, &gs) < 0) {
+ fclose(fp);
return FALSE;
}
} /* while */
diff --git a/misc.c b/misc.c
index b1d039d..fc7f488 100644
--- a/misc.c
+++ b/misc.c
@@ -28,7 +28,7 @@ other dealings in this Software without prior written authorization
from the X Consortium.
*/
-/* $XFree86: xc/programs/xman/misc.c,v 1.7 2001/12/28 17:09:08 dawes Exp $ */
+/* $XFree86: xc/programs/xman/misc.c,v 1.10 2003/08/02 17:35:48 herrb Exp $ */
/*
* xman - X window system manual page display program.
@@ -44,12 +44,6 @@ from the X Consortium.
#include <X11/Xaw/Dialog.h>
#include <X11/Shell.h>
-#ifndef HAS_SNPRINTF
-#undef SCOPE
-#define SCOPE static
-#include "snprintf.c"
-#endif
-
static FILE * Uncompress(ManpageGlobals * man_globals, char * filename);
#ifndef HAS_MKSTEMP
static Boolean UncompressNamed(ManpageGlobals * man_globals, char * filename,
@@ -98,15 +92,10 @@ PopupWarning(ManpageGlobals * man_globals, char * string)
Arg wargs[3];
Dimension topX, topY;
char buffer[BUFSIZ];
- Widget positionto;
Boolean hasPosition;
sprintf( buffer, "Xman Warning: %s", string);
hasPosition = FALSE;
- if (man_globals->This_Manpage)
- positionto = man_globals->This_Manpage;
- else
- positionto = top;
if (top)
{
n=0;
@@ -601,6 +590,9 @@ ConstructCommand(cmdbuf, path, filename, tempfile)
char fmtbuf[128];
int gotfmt = 0; /* set to 1 if we got a directive from source */
char *fname = NULL;
+#ifdef __UNIXOS2__
+ int i;
+#endif
fmt = NULL;
/* If you have a command line option that gives a setting for fmt,
@@ -646,7 +638,15 @@ ConstructCommand(cmdbuf, path, filename, tempfile)
/* Start with the first fixed part of the command line */
+#ifdef __UNIXOS2__
+ for (i = 0; i < strlen(path); i++) {
+ if (path[i] == '/')
+ path[i] = '\\';
+ }
+ used = snprintf(c, left, "cd %s & %s %s ", path, ZSOELIM, filename);
+#else
used = snprintf(c, left, "cd %s; %s %s ", path, ZSOELIM, filename);
+#endif
left -= used;
c += used;
if (left <= 1)
@@ -691,11 +691,15 @@ ConstructCommand(cmdbuf, path, filename, tempfile)
}
/* Now add the fixed trailing part 'formatprog > tempfile 2> /dev/null' */
+#ifdef __UNIXOS2__
+ used = snprintf(c, left, " | %s > %s 2>NUL", FORMAT, tempfile);
+#else
#ifndef HAS_MKSTEMP
used = snprintf(c, left, " | %s > %s 2>/dev/null", FORMAT, tempfile);
#else
used = snprintf(c, left, " | %s >> %s 2>/dev/null", FORMAT, tempfile);
#endif
+#endif /* __UNIXOS2__ */
left -= used;
if (left <= 1)
return (FALSE);
diff --git a/search.c b/search.c
index 052dae0..eece3b6 100644
--- a/search.c
+++ b/search.c
@@ -28,7 +28,7 @@ other dealings in this Software without prior written authorization
from the X Consortium.
*/
-/* $XFree86: xc/programs/xman/search.c,v 1.5 2001/01/27 17:24:27 herrb Exp $ */
+/* $XFree86: xc/programs/xman/search.c,v 1.6 2003/04/09 20:31:31 herrb Exp $ */
#include "globals.h"
@@ -38,7 +38,7 @@ from the X Consortium.
#define SEARCHARGS 10
-FILE * DoManualSearch(ManpageGlobals *man_globals, char * string);
+static FILE * DoManualSearch(ManpageGlobals *man_globals, char * string);
static int BEntrySearch(char * string, char ** first, int number);
/* Function Name: MakeSearchWidget
@@ -301,7 +301,7 @@ DoSearch(ManpageGlobals * man_globals, int type)
#define NO_ENTRY -100
-FILE *
+static FILE *
DoManualSearch(ManpageGlobals *man_globals, char * string)
{
int e_num = NO_ENTRY;
diff --git a/vendor.h b/vendor.h
index 43d28c9..1b57574 100644
--- a/vendor.h
+++ b/vendor.h
@@ -28,7 +28,7 @@ other dealings in this Software without prior written authorization
from the X Consortium.
*/
-/* $XFree86: xc/programs/xman/vendor.h,v 1.11 2002/09/21 02:38:25 dawes Exp $ */
+/* $XFree86: xc/programs/xman/vendor.h,v 1.13 2003/07/29 21:16:56 dawes Exp $ */
/* Vendor-specific definitions */
@@ -167,25 +167,19 @@ from the X Consortium.
# elif defined(BSD) && (BSD >= 199103)
# define FORMAT "| eqn | tbl | nroff -man"
# elif defined(linux)
-# define FORMAT "| geqn | gtbl | groff -Tlatin1 -mandoc"
+# define FORMAT "| eqn | tbl | GROFF_NO_SGR= groff -Tlatin1 -mandoc"
# else
# define FORMAT "| neqn | nroff -man" /* The format command. */
# endif
-# if defined(linux)
-# define TBL "gtbl"
-# else
-# define TBL "tbl"
-# endif
+# define TBL "tbl"
#else /* HANDLE_ROFFSEQ */
# if defined(linux)
# define ZSOELIM "zsoelim"
-# define EQN "geqn"
-# define TBL "gtbl"
# else
# define ZSOELIM "soelim"
-# define EQN "eqn"
-# define TBL "tbl"
#endif
+# define EQN "eqn"
+# define TBL "tbl"
# define GRAP "grap"
# define PIC "pic"
# define VGRIND "vgrind"
@@ -193,7 +187,9 @@ from the X Consortium.
# if defined(CSRG_BASED)
# define FORMAT "nroff -mandoc"
# elif defined(linux)
-# define FORMAT "groff -Tlatin1 -mandoc"
+# define FORMAT "GROFF_NO_SGR= groff -Tlatin1 -mandoc"
+# elif defined(__DARWIN__)
+# define FORMAT "nroff -man"
# else
# define FORMAT "groff -man"
# endif