summaryrefslogtreecommitdiff
path: root/x11/kdebase/patches/patch-bc
blob: 0b48e86a9d8adc9d1a868693fd845f61959f3dc0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
$NetBSD: patch-bc,v 1.5 2003/07/02 18:06:40 jmmv Exp $

--- kdehelp/man.cpp.orig	Thu Aug 19 20:32:11 1999
+++ kdehelp/man.cpp
@@ -20,6 +20,9 @@
 #include "man.h"
 #include "error.h"
 #include <errno.h>
+#ifdef __NetBSD__
+#include <sys/param.h>
+#endif
 
 #include "dbnew.h"
 
@@ -171,11 +174,17 @@
         }
         else
         {
-#ifndef __FreeBSD__
-            searchPath[numPaths++] = StrDup("/usr/man");
-#else
+#ifdef __FreeBSD__
             searchPath[numPaths++] = StrDup(_PATH_MAN);
             searchPath[numPaths++] = StrDup("/usr/X11R6/man");
+#else
+#ifdef __NetBSD__
+            searchPath[numPaths++] = StrDup(PREFIX "/man");
+            searchPath[numPaths++] = StrDup("/usr/share/man");
+            searchPath[numPaths++] = StrDup("/usr/X11R6/man");
+#else
+            searchPath[numPaths++] = StrDup("/usr/man");
+#endif
 #endif
             searchPath[numPaths++] = StrDup("/usr/local/man");
         }
@@ -271,10 +280,18 @@
 //
 void cManSection::ReadDir(const char *dirName )
 {
+#ifdef __NetBSD__
+	DIR *dir, *subdir;
+#else
 	DIR *dir;
+#endif
 	struct dirent *dirEntry;
 	char *ptr;
+#ifdef __NetBSD__
+	char buffer[256], subdirName[256];
+#else
 	char buffer[256];
+#endif
 
 //	cout << klocale->translate("Reading Dir: ") << dirName << endl;
 
@@ -287,6 +304,39 @@
             if ( dirEntry->d_name[0] == '.' )
                 continue;
 
+#ifdef __NetBSD__
+            if ( !strcmp( dirEntry->d_name, MACHINE_ARCH ) )
+	    {
+		  sprintf( subdirName, "%s/%s", dirName, MACHINE_ARCH );
+		  subdir = opendir(subdirName);
+		  if ( subdir )
+		  {
+		      while ( (dirEntry = readdir(subdir)) )
+		      {
+			  if ( dirEntry->d_name[0] == '.' )
+			      continue;
+
+			  strcpy( buffer, dirEntry->d_name );
+
+			  ptr = strrchr( buffer, '.' );
+			  if ( !strcmp(ptr, ".gz") || !strcmp(ptr, ".Z") ||
+			       !strcmp(ptr,".bz2") ) // skip compress extn
+			  {
+			      *ptr = '\0';
+			      ptr = strrchr( buffer, '.' );
+			  }
+			  if (ptr)
+			  {
+			      *ptr = '\0';
+			      AddPage( buffer );
+			  }
+		      }
+		      closedir(subdir);
+		  }
+		  continue;
+	    }
+#endif	/* __NetBSD__ */
+
             strcpy( buffer, dirEntry->d_name );
 
             ptr = strrchr( buffer, '.' );
@@ -475,8 +525,12 @@
 		sprintf(errFile, "%s/khelpXXXXXX", _PATH_TMP);	// temp file
 		mktemp(errFile);
 
+#ifdef RMAN
+		sprintf(rmanCmd, "%s -f HTML", RMAN);
+#else
 		sprintf(rmanCmd, "%s/rman -f HTML",
 			(const char *)KApplication::kde_bindir());
+#endif
 
 		// create the system cmd to read the man page
 		if ( (ptr = strchr(tmpName, '(')) )