Subversion Repositories Keine

Rev

Rev 4 | Rev 7 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4 Rev 6
Line 1... Line 1...
1
/* $Id: man.c 4 2024-09-11 10:22:22Z nishi $ */
1
/* $Id: man.c 6 2024-09-11 15:45:32Z nishi $ */
2
 
2
 
3
#include "../config.h"
3
#include "../config.h"
4
 
4
 
5
#include "kn_man.h"
5
#include "kn_man.h"
6
 
6
 
Line 42... Line 42...
42
	}
42
	}
43
	return NULL;
43
	return NULL;
44
}
44
}
45
 
45
 
46
bool kn_has_manpage(const char* str) {
46
bool kn_has_manpage(const char* str) {
-
 
47
#ifdef MANPAGE_DIRS
-
 
48
	int i;
-
 
49
	const char* dirs[] = MANPAGE_DIRS;
-
 
50
	for(i = 0; i < sizeof(dirs) / sizeof(*dirs); i++){
-
 
51
		char* pth = kn_find(dirs[i], str);
-
 
52
		if(pth != NULL){
-
 
53
			free(pth);
-
 
54
			return true;
-
 
55
		}
-
 
56
	}
-
 
57
	return false;
-
 
58
#else
47
	char* pth = kn_find(MANPAGE_DIR, str);
59
	char* pth = kn_find(MANPAGE_DIR, str);
48
	if(pth == NULL) return false;
60
	if(pth == NULL) return false;
49
	free(pth);
61
	free(pth);
-
 
62
#endif
50
	return true;
63
	return true;
51
}
64
}
52
 
65
 
53
char* kn_manpage_process(const char* path) {
66
char* kn_manpage_process(const char* path) {
54
	char* b = malloc(1);
67
	char* b = malloc(1);