2008-02-07 13:32:48 +00:00
|
|
|
diff -rc man-db-2.5.1-orig/src/manp.c man-db-2.5.1/src/manp.c
|
|
|
|
*** man-db-2.5.1-orig/src/manp.c 2008-01-07 03:23:11.000000000 +0100
|
|
|
|
--- man-db-2.5.1/src/manp.c 2008-02-07 14:20:20.000000000 +0100
|
2007-01-09 21:13:31 +00:00
|
|
|
***************
|
2008-02-07 13:32:48 +00:00
|
|
|
*** 96,102 ****
|
2007-01-09 21:13:31 +00:00
|
|
|
|
|
|
|
static void mkcatdirs (const char *mandir, const char *catdir);
|
2008-02-07 13:32:48 +00:00
|
|
|
static inline char *get_manpath_from_path (const char *path);
|
|
|
|
! static inline char *has_mandir (const char *p);
|
|
|
|
static inline char *fsstnd (const char *path);
|
2007-01-09 21:13:31 +00:00
|
|
|
static char *def_path (int flag);
|
|
|
|
static void add_dir_to_list (char **lp, const char *dir);
|
2008-02-07 13:32:48 +00:00
|
|
|
--- 96,102 ----
|
2007-01-09 21:13:31 +00:00
|
|
|
|
|
|
|
static void mkcatdirs (const char *mandir, const char *catdir);
|
2008-02-07 13:32:48 +00:00
|
|
|
static inline char *get_manpath_from_path (const char *path);
|
|
|
|
! static inline char *has_mandir (const char *p, const char *mandir);
|
|
|
|
static inline char *fsstnd (const char *path);
|
2007-01-09 21:13:31 +00:00
|
|
|
static char *def_path (int flag);
|
|
|
|
static void add_dir_to_list (char **lp, const char *dir);
|
|
|
|
***************
|
2008-02-07 13:32:48 +00:00
|
|
|
*** 928,934 ****
|
|
|
|
} else {
|
|
|
|
debug ("is not in the config file\n");
|
2007-01-09 21:13:31 +00:00
|
|
|
|
|
|
|
! t = has_mandir (p);
|
|
|
|
if (t) {
|
2008-02-07 13:32:48 +00:00
|
|
|
debug ("but does have a ../man or man "
|
|
|
|
"subdirectory\n");
|
|
|
|
--- 928,934 ----
|
|
|
|
} else {
|
|
|
|
debug ("is not in the config file\n");
|
2007-01-09 21:13:31 +00:00
|
|
|
|
|
|
|
! t = has_mandir (p, "man");
|
|
|
|
if (t) {
|
2008-02-07 13:32:48 +00:00
|
|
|
debug ("but does have a ../man or man "
|
|
|
|
"subdirectory\n");
|
2007-01-09 21:13:31 +00:00
|
|
|
***************
|
2008-02-07 13:32:48 +00:00
|
|
|
*** 938,943 ****
|
|
|
|
--- 938,952 ----
|
2007-01-09 21:13:31 +00:00
|
|
|
} else
|
2008-02-07 13:32:48 +00:00
|
|
|
debug ("and doesn't have ../man or man "
|
|
|
|
"subdirectories\n");
|
|
|
|
+
|
|
|
|
+ t = has_mandir (p, "share/man");
|
|
|
|
+ if (t) {
|
|
|
|
+ debug ("but does have a ../share/man or share/man subdirectory\n");
|
|
|
|
+
|
|
|
|
+ add_dir_to_list (tmplist, t);
|
|
|
|
+ free (t);
|
|
|
|
+ } else
|
|
|
|
+ debug ("and doesn't have ../share/man or share/man subdirectories\n");
|
2007-01-09 21:13:31 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
***************
|
2008-02-07 13:32:48 +00:00
|
|
|
*** 1013,1019 ****
|
2007-01-09 21:13:31 +00:00
|
|
|
|
|
|
|
/* path does not exist in config file: check to see if path/../man or
|
|
|
|
path/man exist. If so return it, if not return NULL. */
|
2008-02-07 13:32:48 +00:00
|
|
|
! static inline char *has_mandir (const char *path)
|
2007-01-09 21:13:31 +00:00
|
|
|
{
|
|
|
|
char *newpath = NULL;
|
|
|
|
|
2008-02-07 13:32:48 +00:00
|
|
|
--- 1022,1028 ----
|
2007-01-09 21:13:31 +00:00
|
|
|
|
|
|
|
/* path does not exist in config file: check to see if path/../man or
|
|
|
|
path/man exist. If so return it, if not return NULL. */
|
2008-02-07 13:32:48 +00:00
|
|
|
! static inline char *has_mandir (const char *path, const char *mandir)
|
2007-01-09 21:13:31 +00:00
|
|
|
{
|
|
|
|
char *newpath = NULL;
|
|
|
|
|
|
|
|
***************
|
2008-02-07 13:32:48 +00:00
|
|
|
*** 1023,1031 ****
|
2007-01-09 21:13:31 +00:00
|
|
|
char *subdir = strrchr (path, '/');
|
|
|
|
if (subdir) {
|
|
|
|
const int prefix_len = subdir + 1 - path;
|
|
|
|
! newpath = xmalloc (prefix_len + sizeof ("man") + 1);
|
|
|
|
strncpy (newpath, path, prefix_len);
|
|
|
|
! strcpy (newpath + prefix_len, "man");
|
|
|
|
|
|
|
|
if (is_directory (newpath) == 1)
|
|
|
|
return newpath;
|
2008-02-07 13:32:48 +00:00
|
|
|
--- 1032,1040 ----
|
2007-01-09 21:13:31 +00:00
|
|
|
char *subdir = strrchr (path, '/');
|
|
|
|
if (subdir) {
|
|
|
|
const int prefix_len = subdir + 1 - path;
|
|
|
|
! newpath = xmalloc (prefix_len + strlen (mandir) + 2);
|
|
|
|
strncpy (newpath, path, prefix_len);
|
|
|
|
! strcpy (newpath + prefix_len, mandir);
|
|
|
|
|
|
|
|
if (is_directory (newpath) == 1)
|
|
|
|
return newpath;
|
|
|
|
***************
|
2008-02-07 13:32:48 +00:00
|
|
|
*** 1033,1039 ****
|
2007-01-09 21:13:31 +00:00
|
|
|
*newpath = '\0';
|
|
|
|
}
|
|
|
|
|
2008-02-07 13:32:48 +00:00
|
|
|
! newpath = appendstr (newpath, path, "/man", NULL);
|
2007-01-09 21:13:31 +00:00
|
|
|
|
|
|
|
if (is_directory (newpath) == 1)
|
|
|
|
return newpath;
|
2008-02-07 13:32:48 +00:00
|
|
|
--- 1042,1048 ----
|
2007-01-09 21:13:31 +00:00
|
|
|
*newpath = '\0';
|
|
|
|
}
|
|
|
|
|
2008-02-07 13:32:48 +00:00
|
|
|
! newpath = appendstr (newpath, path, "/", mandir, NULL);
|
2007-01-09 21:13:31 +00:00
|
|
|
|
|
|
|
if (is_directory (newpath) == 1)
|
|
|
|
return newpath;
|