parent
43051dd9d7
commit
1d578fe9e0
2
.gitignore
vendored
2
.gitignore
vendored
@ -1 +1 @@
|
||||
/man-db-2.6.3.tar.xz
|
||||
/man-db-2.6.4.tar.xz
|
||||
|
@ -1,24 +0,0 @@
|
||||
diff -up man-db-2.5.9/include/manconfig.h.in.sgr man-db-2.5.9/include/manconfig.h.in
|
||||
--- man-db-2.5.9/include/manconfig.h.in.sgr 2010-11-17 12:30:36.000000000 +0100
|
||||
+++ man-db-2.5.9/include/manconfig.h.in 2010-11-24 11:29:57.000000000 +0100
|
||||
@@ -128,7 +128,7 @@
|
||||
|
||||
#ifndef NROFF_MISSING
|
||||
# ifndef NROFF
|
||||
-# define NROFF "@nroff@"
|
||||
+# define NROFF "@nroff@ -c"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
diff -up man-db-2.5.9/src/man_db.conf.in.sgr man-db-2.5.9/src/man_db.conf.in
|
||||
--- man-db-2.5.9/src/man_db.conf.in.sgr 2009-03-15 13:17:24.000000000 +0100
|
||||
+++ man-db-2.5.9/src/man_db.conf.in 2010-11-24 11:27:45.000000000 +0100
|
||||
@@ -80,7 +80,7 @@ MANDB_MAP /opt/man /var/cache/man/opt
|
||||
#DEFINE tr @tr@ '\255\267\264\327' '\055\157\047\170'
|
||||
#DEFINE grep @grep@
|
||||
#DEFINE troff @troff@
|
||||
-#DEFINE nroff @nroff@
|
||||
+#DEFINE nroff @nroff@ -c
|
||||
#DEFINE eqn @eqn@
|
||||
#DEFINE neqn @neqn@
|
||||
#DEFINE tbl @tbl@
|
@ -1,84 +0,0 @@
|
||||
diff -up man-db-2.6.2/src/Makefile.am.so-links man-db-2.6.2/src/Makefile.am
|
||||
--- man-db-2.6.2/src/Makefile.am.so-links 2012-07-20 19:21:13.000000000 +0200
|
||||
+++ man-db-2.6.2/src/Makefile.am 2012-07-20 19:21:13.000000000 +0200
|
||||
@@ -87,6 +87,8 @@ lexgrog_SOURCES = \
|
||||
descriptions.h \
|
||||
filenames.c \
|
||||
filenames.h \
|
||||
+ globbing.c \
|
||||
+ globbing.h \
|
||||
lexgrog.l \
|
||||
lexgrog_test.c \
|
||||
manconv.c \
|
||||
diff -up man-db-2.6.2/src/Makefile.in.so-links man-db-2.6.2/src/Makefile.in
|
||||
--- man-db-2.6.2/src/Makefile.in.so-links 2012-07-20 19:21:13.000000000 +0200
|
||||
+++ man-db-2.6.2/src/Makefile.in 2012-07-20 19:21:39.000000000 +0200
|
||||
@@ -257,7 +257,7 @@ catman_DEPENDENCIES = $(am__DEPENDENCIES
|
||||
am_globbing_OBJECTS = globbing.$(OBJEXT) globbing_test.$(OBJEXT)
|
||||
globbing_OBJECTS = $(am_globbing_OBJECTS)
|
||||
globbing_DEPENDENCIES = $(am__DEPENDENCIES_1)
|
||||
-am_lexgrog_OBJECTS = compression.$(OBJEXT) descriptions.$(OBJEXT) \
|
||||
+am_lexgrog_OBJECTS = globbing.$(OBJEXT) compression.$(OBJEXT) descriptions.$(OBJEXT) \
|
||||
filenames.$(OBJEXT) lexgrog.$(OBJEXT) lexgrog_test.$(OBJEXT) \
|
||||
manconv.$(OBJEXT) manconv_client.$(OBJEXT) ult_src.$(OBJEXT)
|
||||
lexgrog_OBJECTS = $(am_lexgrog_OBJECTS)
|
||||
@@ -1356,6 +1356,8 @@ lexgrog_SOURCES = \
|
||||
descriptions.h \
|
||||
filenames.c \
|
||||
filenames.h \
|
||||
+ globbing.c \
|
||||
+ globbing.h \
|
||||
lexgrog.l \
|
||||
lexgrog_test.c \
|
||||
manconv.c \
|
||||
diff -up man-db-2.6.2/src/ult_src.c.so-links man-db-2.6.2/src/ult_src.c
|
||||
--- man-db-2.6.2/src/ult_src.c.so-links 2012-06-18 04:28:56.000000000 +0200
|
||||
+++ man-db-2.6.2/src/ult_src.c 2012-07-20 19:21:13.000000000 +0200
|
||||
@@ -59,6 +59,8 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#include "canonicalize.h"
|
||||
+#include "dirname.h"
|
||||
+#include "globbing.h"
|
||||
|
||||
#include "gettext.h"
|
||||
#define _(String) gettext (String)
|
||||
@@ -343,6 +345,38 @@ const char *ult_src (const char *name, c
|
||||
free (base);
|
||||
base = appendstr (NULL, path, "/", include,
|
||||
NULL);
|
||||
+
|
||||
+ /* If the original path from above doesn't exist, try to create
|
||||
+ * new path as if the "include" was relative to the current
|
||||
+ * man page.
|
||||
+ */
|
||||
+ if (access (base, F_OK) != 0) {
|
||||
+ char *dirname = mdir_name (name);
|
||||
+ char *tempFile = appendstr (NULL, dirname, "/", include,
|
||||
+ NULL);
|
||||
+ free (dirname);
|
||||
+ if (access (tempFile, F_OK) == 0) {
|
||||
+ free (base);
|
||||
+ base = canonicalize_filename_mode (tempFile,
|
||||
+ CAN_EXISTING);
|
||||
+ } else {
|
||||
+ char *tempFileAsterisk = appendstr (NULL, tempFile,
|
||||
+ "*", NULL);
|
||||
+ char **possibleFiles = expand_path (tempFileAsterisk);
|
||||
+ free (tempFileAsterisk);
|
||||
+ if (access (possibleFiles[0], F_OK) == 0) {
|
||||
+ free (base);
|
||||
+ base = canonicalize_filename_mode (possibleFiles[0],
|
||||
+ CAN_EXISTING);
|
||||
+ }
|
||||
+ int i;
|
||||
+ for (i = 0; possibleFiles[i] != NULL; i++) {
|
||||
+ free (possibleFiles[i]);
|
||||
+ }
|
||||
+ free (possibleFiles);
|
||||
+ }
|
||||
+ free (tempFile);
|
||||
+ }
|
||||
free (include);
|
||||
|
||||
debug ("ult_src: points to %s\n", base);
|
@ -1,292 +0,0 @@
|
||||
diff -upr man-db-2.6.3.orig/src/globbing.c man-db-2.6.3/src/globbing.c
|
||||
--- man-db-2.6.3.orig/src/globbing.c 2010-09-26 23:08:14.000000000 +0200
|
||||
+++ man-db-2.6.3/src/globbing.c 2013-03-13 18:18:52.615033484 +0100
|
||||
@@ -427,3 +427,30 @@ char **look_for_file (const char *hier,
|
||||
else
|
||||
return gbuf.gl_pathv;
|
||||
}
|
||||
+
|
||||
+char **expand_path (const char *path)
|
||||
+{
|
||||
+ int res = 0;
|
||||
+ char **result = NULL;
|
||||
+ glob_t globbuf;
|
||||
+
|
||||
+ res = glob (path, 0, NULL, &globbuf);
|
||||
+ /* if glob failed, return the given path */
|
||||
+ if (res != 0) {
|
||||
+ result = (char **) xmalloc (2 * sizeof(char *));
|
||||
+ result[0] = xstrndup (path, strlen(path));
|
||||
+ result[1] = NULL;
|
||||
+ return result;
|
||||
+ }
|
||||
+
|
||||
+ result = (char **) xmalloc ((globbuf.gl_pathc + 1) * sizeof(char *));
|
||||
+ size_t i;
|
||||
+ for (i = 0; i < globbuf.gl_pathc; i++) {
|
||||
+ result[i] = xstrndup (globbuf.gl_pathv[i], strlen (globbuf.gl_pathv[i]));
|
||||
+ }
|
||||
+ result[globbuf.gl_pathc] = NULL;
|
||||
+
|
||||
+ globfree (&globbuf);
|
||||
+
|
||||
+ return result;
|
||||
+}
|
||||
diff -upr man-db-2.6.3.orig/src/globbing.h man-db-2.6.3/src/globbing.h
|
||||
--- man-db-2.6.3.orig/src/globbing.h 2008-12-11 00:06:18.000000000 +0100
|
||||
+++ man-db-2.6.3/src/globbing.h 2013-03-13 18:18:52.615033484 +0100
|
||||
@@ -29,3 +29,6 @@ enum look_for_file_opts {
|
||||
/* globbing.c */
|
||||
extern char **look_for_file (const char *hier, const char *sec,
|
||||
const char *unesc_name, int cat, int opts);
|
||||
+
|
||||
+/* Expand path with wildcards into list of all existing directories. */
|
||||
+extern char **expand_path (const char *path);
|
||||
diff -upr man-db-2.6.3.orig/src/Makefile.am man-db-2.6.3/src/Makefile.am
|
||||
--- man-db-2.6.3.orig/src/Makefile.am 2012-02-05 14:25:20.000000000 +0100
|
||||
+++ man-db-2.6.3/src/Makefile.am 2013-03-13 18:18:52.617033454 +0100
|
||||
@@ -72,6 +72,8 @@ zsoelim_LDADD = $(LIBMAN) $(libpipeline_
|
||||
accessdb_SOURCES = \
|
||||
accessdb.c
|
||||
catman_SOURCES = \
|
||||
+ globbing.c \
|
||||
+ globbing.h \
|
||||
catman.c \
|
||||
manp.c \
|
||||
manp.h
|
||||
@@ -140,10 +142,14 @@ mandb_SOURCES = \
|
||||
ult_src.c \
|
||||
ult_src.h
|
||||
manpath_SOURCES = \
|
||||
+ globbing.c \
|
||||
+ globbing.h \
|
||||
manp.c \
|
||||
manp.h \
|
||||
manpath.c
|
||||
whatis_SOURCES = \
|
||||
+ globbing.c \
|
||||
+ globbing.h \
|
||||
manconv.c \
|
||||
manconv.h \
|
||||
manp.c \
|
||||
diff -upr man-db-2.6.3.orig/src/Makefile.in man-db-2.6.3/src/Makefile.in
|
||||
--- man-db-2.6.3.orig/src/Makefile.in 2012-09-18 00:34:03.000000000 +0200
|
||||
+++ man-db-2.6.3/src/Makefile.in 2013-03-13 18:20:57.097203869 +0100
|
||||
@@ -251,7 +251,7 @@ accessdb_DEPENDENCIES = $(am__DEPENDENCI
|
||||
AM_V_lt = $(am__v_lt_@AM_V@)
|
||||
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
|
||||
am__v_lt_0 = --silent
|
||||
-am_catman_OBJECTS = catman.$(OBJEXT) manp.$(OBJEXT)
|
||||
+am_catman_OBJECTS = globbing.$(OBJEXT) catman.$(OBJEXT) manp.$(OBJEXT)
|
||||
catman_OBJECTS = $(am_catman_OBJECTS)
|
||||
catman_DEPENDENCIES = $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_2)
|
||||
am_globbing_OBJECTS = globbing.$(OBJEXT) globbing_test.$(OBJEXT)
|
||||
@@ -282,10 +282,10 @@ am_mandb_OBJECTS = check_mandirs.$(OBJEX
|
||||
mandb_OBJECTS = $(am_mandb_OBJECTS)
|
||||
mandb_DEPENDENCIES = $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_2) \
|
||||
$(am__DEPENDENCIES_2)
|
||||
-am_manpath_OBJECTS = manp.$(OBJEXT) manpath.$(OBJEXT)
|
||||
+am_manpath_OBJECTS = globbing.$(OBJEXT) manp.$(OBJEXT) manpath.$(OBJEXT)
|
||||
manpath_OBJECTS = $(am_manpath_OBJECTS)
|
||||
manpath_DEPENDENCIES = $(am__DEPENDENCIES_1)
|
||||
-am_whatis_OBJECTS = manconv.$(OBJEXT) manp.$(OBJEXT) whatis.$(OBJEXT)
|
||||
+am_whatis_OBJECTS = globbing.$(OBJEXT) manconv.$(OBJEXT) manp.$(OBJEXT) whatis.$(OBJEXT)
|
||||
whatis_OBJECTS = $(am_whatis_OBJECTS)
|
||||
whatis_DEPENDENCIES = $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_2) \
|
||||
$(am__DEPENDENCIES_2)
|
||||
@@ -1339,6 +1339,8 @@ accessdb_SOURCES = \
|
||||
|
||||
catman_SOURCES = \
|
||||
catman.c \
|
||||
+ globbing.c \
|
||||
+ globbing.h \
|
||||
manp.c \
|
||||
manp.h
|
||||
|
||||
@@ -1412,11 +1414,15 @@ mandb_SOURCES = \
|
||||
ult_src.h
|
||||
|
||||
manpath_SOURCES = \
|
||||
+ globbing.c \
|
||||
+ globbing.h \
|
||||
manp.c \
|
||||
manp.h \
|
||||
manpath.c
|
||||
|
||||
whatis_SOURCES = \
|
||||
+ globbing.c \
|
||||
+ globbing.h \
|
||||
manconv.c \
|
||||
manconv.h \
|
||||
manp.c \
|
||||
diff -upr man-db-2.6.3.orig/src/manp.c man-db-2.6.3/src/manp.c
|
||||
--- man-db-2.6.3.orig/src/manp.c 2012-02-05 14:18:59.000000000 +0100
|
||||
+++ man-db-2.6.3/src/manp.c 2013-03-13 18:18:52.652032940 +0100
|
||||
@@ -75,6 +75,7 @@
|
||||
#endif
|
||||
|
||||
#include "manp.h"
|
||||
+#include "globbing.h"
|
||||
|
||||
struct list {
|
||||
char *key;
|
||||
@@ -1035,32 +1036,45 @@ char *get_manpath_from_path (const char
|
||||
static void add_dir_to_list (char **lp, const char *dir)
|
||||
{
|
||||
int status;
|
||||
- int pos = 0;
|
||||
-
|
||||
- while (*lp != NULL) {
|
||||
- if (pos > MAXDIRS - 1)
|
||||
- gripe_overlong_list ();
|
||||
- if (!strcmp (*lp, dir)) {
|
||||
- debug ("%s is already in the manpath\n", dir);
|
||||
- return;
|
||||
+ int pos = 0, i = 0;
|
||||
+ char *d = NULL;
|
||||
+ char **expanded_dirs = NULL;
|
||||
+
|
||||
+ expanded_dirs = expand_path (dir);
|
||||
+ for (i = 0; expanded_dirs[i] != NULL; i++) {
|
||||
+ d = expanded_dirs[i];
|
||||
+
|
||||
+ while (*lp != NULL) {
|
||||
+ if (pos > MAXDIRS - 1)
|
||||
+ gripe_overlong_list ();
|
||||
+ if (!strcmp (*lp, d)) {
|
||||
+ debug ("%s is already in the manpath\n", d);
|
||||
+ goto done;
|
||||
+ }
|
||||
+ lp++;
|
||||
+ pos++;
|
||||
}
|
||||
- lp++;
|
||||
- pos++;
|
||||
- }
|
||||
|
||||
- /* Not found -- add it. */
|
||||
+ /* Not found -- add it. */
|
||||
|
||||
- status = is_directory (dir);
|
||||
+ status = is_directory (d);
|
||||
|
||||
- if (status < 0)
|
||||
- gripe_stat_file (dir);
|
||||
- else if (status == 0)
|
||||
- gripe_not_directory (dir);
|
||||
- else if (status == 1) {
|
||||
- debug ("adding %s to manpath\n", dir);
|
||||
+ if (status < 0)
|
||||
+ gripe_stat_file (d);
|
||||
+ else if (status == 0)
|
||||
+ gripe_not_directory (d);
|
||||
+ else if (status == 1) {
|
||||
+ debug ("adding %s to manpath\n", d);
|
||||
|
||||
- *lp = xstrdup (dir);
|
||||
+ *lp = xstrdup (d);
|
||||
+ }
|
||||
}
|
||||
+
|
||||
+done:
|
||||
+ for (i = 0; expanded_dirs[i] != NULL; i++) {
|
||||
+ free (expanded_dirs[i]);
|
||||
+ }
|
||||
+ free (expanded_dirs);
|
||||
}
|
||||
|
||||
/* path does not exist in config file: check to see if path/../man,
|
||||
@@ -1104,33 +1118,44 @@ static inline char *has_mandir (const ch
|
||||
|
||||
static char **add_dir_to_path_list (char **mphead, char **mp, const char *p)
|
||||
{
|
||||
- int status;
|
||||
+ int status, i = 0;
|
||||
char *cwd;
|
||||
+ char *d = NULL;
|
||||
+ char **expanded_dirs = NULL;
|
||||
|
||||
if (mp - mphead > MAXDIRS - 1)
|
||||
gripe_overlong_list ();
|
||||
|
||||
- status = is_directory (p);
|
||||
-
|
||||
- if (status < 0)
|
||||
- gripe_stat_file (p);
|
||||
- else if (status == 0)
|
||||
- gripe_not_directory (p);
|
||||
- else {
|
||||
- /* deal with relative paths */
|
||||
+ expanded_dirs = expand_path (p);
|
||||
+ for (i = 0; expanded_dirs[i] != NULL; i++) {
|
||||
+ d = expanded_dirs[i];
|
||||
+
|
||||
+ status = is_directory (d);
|
||||
+
|
||||
+ if (status < 0)
|
||||
+ gripe_stat_file (d);
|
||||
+ else if (status == 0)
|
||||
+ gripe_not_directory (d);
|
||||
+ else {
|
||||
+ /* deal with relative paths */
|
||||
+
|
||||
+ if (*d != '/') {
|
||||
+ cwd = xgetcwd ();
|
||||
+ if (!cwd)
|
||||
+ error (FATAL, errno,
|
||||
+ _("can't determine current directory"));
|
||||
+ *mp = appendstr (cwd, "/", d, NULL);
|
||||
+ } else
|
||||
+ *mp = xstrdup (d);
|
||||
|
||||
- if (*p != '/') {
|
||||
- cwd = xgetcwd ();
|
||||
- if (!cwd)
|
||||
- error (FATAL, errno,
|
||||
- _("can't determine current directory"));
|
||||
- *mp = appendstr (cwd, "/", p, NULL);
|
||||
- } else
|
||||
- *mp = xstrdup (p);
|
||||
+ debug ("adding %s to manpathlist\n", *mp);
|
||||
+ mp++;
|
||||
+ }
|
||||
|
||||
- debug ("adding %s to manpathlist\n", *mp);
|
||||
- mp++;
|
||||
+ free (d);
|
||||
}
|
||||
+ free (expanded_dirs);
|
||||
+
|
||||
return mp;
|
||||
}
|
||||
|
||||
diff -up man-db-2.6.3/src/tests/mandb-3.wildcards man-db-2.6.3/src/tests/mandb-3
|
||||
--- man-db-2.6.3/src/tests/mandb-3.wildcards 2010-11-14 23:11:27.000000000 +0100
|
||||
+++ man-db-2.6.3/src/tests/mandb-3 2013-03-21 16:20:24.735861291 +0100
|
||||
@@ -27,16 +27,16 @@ EOF
|
||||
accessdb_filter "$tmpdir/usr/share/man/index$db_ext" >"$tmpdir/1.out"
|
||||
expect_pass 'setup' 'diff -u "$tmpdir/1.exp" "$tmpdir/1.out"'
|
||||
|
||||
-next_second
|
||||
-echo '.so test.1' | gzip -9c >"$tmpdir/usr/share/man/man1/testlink.1.gz"
|
||||
-MANPATH="$tmpdir/usr/share/man" run $MANDB -C "$tmpdir/manpath.config" -u -q \
|
||||
- "$tmpdir/usr/share/man"
|
||||
-cat >"$tmpdir/2.exp" <<EOF
|
||||
-test -> "- 1 1 MTIME A - - gz test page"
|
||||
-testlink -> "- 1 1 MTIME C test - gz "
|
||||
-EOF
|
||||
-accessdb_filter "$tmpdir/usr/share/man/index$db_ext" >"$tmpdir/2.out"
|
||||
-expect_pass 'broken whatis' 'diff -u "$tmpdir/2.exp" "$tmpdir/2.out"'
|
||||
+#next_second
|
||||
+#echo '.so test.1' | gzip -9c >"$tmpdir/usr/share/man/man1/testlink.1.gz"
|
||||
+#MANPATH="$tmpdir/usr/share/man" run $MANDB -C "$tmpdir/manpath.config" -u -q \
|
||||
+# "$tmpdir/usr/share/man"
|
||||
+#cat >"$tmpdir/2.exp" <<EOF
|
||||
+#test -> "- 1 1 MTIME A - - gz test page"
|
||||
+#testlink -> "- 1 1 MTIME C test - gz "
|
||||
+#EOF
|
||||
+#accessdb_filter "$tmpdir/usr/share/man/index$db_ext" >"$tmpdir/2.out"
|
||||
+#expect_pass 'broken whatis' 'diff -u "$tmpdir/2.exp" "$tmpdir/2.out"'
|
||||
|
||||
next_second
|
||||
MANPATH="$tmpdir/usr/share/man" LC_ALL=C run $MANDB \
|
@ -13,16 +13,4 @@ diff -up man-db-2.6.3/src/check_mandirs.c.gcc man-db-2.6.3/src/check_mandirs.c
|
||||
|
||||
while( (mandir = readdir (dir)) ) {
|
||||
if (strncmp (mandir->d_name, "man", 3) != 0)
|
||||
diff -up man-db-2.6.3/src/descriptions_store.c.gcc man-db-2.6.3/src/descriptions_store.c
|
||||
--- man-db-2.6.3/src/descriptions_store.c.gcc 2011-04-10 03:02:26.000000000 +0200
|
||||
+++ man-db-2.6.3/src/descriptions_store.c 2013-03-18 13:53:03.889580350 +0100
|
||||
@@ -71,7 +71,7 @@ void store_descriptions (const struct pa
|
||||
|
||||
if (trace) {
|
||||
for (i = 0; i < trace->len; ++i)
|
||||
- debug ("trace->names[%d] = '%s'\n",
|
||||
+ debug ("trace->names[%zu] = '%s'\n",
|
||||
i, trace->names[i]);
|
||||
}
|
||||
|
||||
diff -up man-db-2.6.3/src/man.c.gcc man-db-2.6.3/src/man.c
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
diff -up man-db-2.6.3/lib/encodings.c.valgrind-mem man-db-2.6.3/lib/encodings.c
|
||||
--- man-db-2.6.3/lib/encodings.c.valgrind-mem 2013-04-05 18:19:01.402892699 +0200
|
||||
+++ man-db-2.6.3/lib/encodings.c 2013-04-05 18:19:01.419892450 +0200
|
||||
diff -up man-db-2.6.4/lib/encodings.c.valgrind-mem man-db-2.6.4/lib/encodings.c
|
||||
--- man-db-2.6.4/lib/encodings.c.valgrind-mem 2013-06-24 18:32:18.598659138 +0200
|
||||
+++ man-db-2.6.4/lib/encodings.c 2013-06-24 18:32:18.613658959 +0200
|
||||
@@ -559,6 +559,7 @@ const char *get_locale_charset (void)
|
||||
|
||||
/* Restore LC_CTYPE to its value on entry to this function. */
|
||||
@ -30,9 +30,9 @@ diff -up man-db-2.6.3/lib/encodings.c.valgrind-mem man-db-2.6.3/lib/encodings.c
|
||||
fclose (supported);
|
||||
return locale;
|
||||
}
|
||||
diff -up man-db-2.6.3/src/check_mandirs.c.valgrind-mem man-db-2.6.3/src/check_mandirs.c
|
||||
--- man-db-2.6.3/src/check_mandirs.c.valgrind-mem 2013-04-05 18:19:01.415892509 +0200
|
||||
+++ man-db-2.6.3/src/check_mandirs.c 2013-04-05 18:19:01.420892435 +0200
|
||||
diff -up man-db-2.6.4/src/check_mandirs.c.valgrind-mem man-db-2.6.4/src/check_mandirs.c
|
||||
--- man-db-2.6.4/src/check_mandirs.c.valgrind-mem 2013-06-24 18:32:18.610658995 +0200
|
||||
+++ man-db-2.6.4/src/check_mandirs.c 2013-06-24 18:32:18.613658959 +0200
|
||||
@@ -442,6 +442,7 @@ static int testmandirs (const char *path
|
||||
|
||||
if (chdir (path) != 0) {
|
||||
@ -63,9 +63,9 @@ diff -up man-db-2.6.3/src/check_mandirs.c.valgrind-mem man-db-2.6.3/src/check_ma
|
||||
return 0;
|
||||
}
|
||||
|
||||
diff -up man-db-2.6.3/src/manconv_client.c.valgrind-mem man-db-2.6.3/src/manconv_client.c
|
||||
--- man-db-2.6.3/src/manconv_client.c.valgrind-mem 2011-01-04 04:04:50.000000000 +0100
|
||||
+++ man-db-2.6.3/src/manconv_client.c 2013-04-05 18:40:45.360739910 +0200
|
||||
diff -up man-db-2.6.4/src/manconv_client.c.valgrind-mem man-db-2.6.4/src/manconv_client.c
|
||||
--- man-db-2.6.4/src/manconv_client.c.valgrind-mem 2011-01-04 04:04:50.000000000 +0100
|
||||
+++ man-db-2.6.4/src/manconv_client.c 2013-06-24 18:32:18.614658947 +0200
|
||||
@@ -111,8 +111,10 @@ void add_manconv (pipeline *p, const cha
|
||||
char *name;
|
||||
pipecmd *cmd;
|
||||
@ -78,9 +78,9 @@ diff -up man-db-2.6.3/src/manconv_client.c.valgrind-mem man-db-2.6.3/src/manconv
|
||||
|
||||
/* informational only; no shell quoting concerns */
|
||||
name = appendstr (NULL, MANCONV, " -f ", NULL);
|
||||
diff -up man-db-2.6.3/src/man.c.valgrind-mem man-db-2.6.3/src/man.c
|
||||
--- man-db-2.6.3/src/man.c.valgrind-mem 2013-04-05 18:19:01.408892611 +0200
|
||||
+++ man-db-2.6.3/src/man.c 2013-04-05 18:40:56.233580113 +0200
|
||||
diff -up man-db-2.6.4/src/man.c.valgrind-mem man-db-2.6.4/src/man.c
|
||||
--- man-db-2.6.4/src/man.c.valgrind-mem 2013-06-24 18:32:18.603659078 +0200
|
||||
+++ man-db-2.6.4/src/man.c 2013-06-24 18:45:21.537924667 +0200
|
||||
@@ -188,7 +188,7 @@ static char *manpathlist[MAXDIRS];
|
||||
/* globals */
|
||||
int quiet = 1;
|
||||
@ -90,16 +90,7 @@ diff -up man-db-2.6.3/src/man.c.valgrind-mem man-db-2.6.3/src/man.c
|
||||
MYDBM_FILE dbf;
|
||||
extern const char *extension; /* for globbing.c */
|
||||
extern char *user_config_file; /* defined in manp.c */
|
||||
@@ -207,7 +207,7 @@ static char *internal_locale, *multiple_
|
||||
static const char *prompt_string;
|
||||
static char *less;
|
||||
static const char *std_sections[] = STD_SECTIONS;
|
||||
-static char *manp;
|
||||
+static char *manp = NULL;
|
||||
static const char *external;
|
||||
static struct hashtable *db_hash = NULL;
|
||||
|
||||
@@ -950,7 +950,7 @@ static int local_man_loop (const char *a
|
||||
@@ -956,7 +956,7 @@ static int local_man_loop (const char *a
|
||||
|
||||
if (directory_on_path (argv_dir)) {
|
||||
char *argv_base = base_name (argv);
|
||||
@ -108,7 +99,7 @@ diff -up man-db-2.6.3/src/man.c.valgrind-mem man-db-2.6.3/src/man.c
|
||||
char **old_manpathlist, **mp;
|
||||
|
||||
debug ("recalculating manpath for executable "
|
||||
@@ -962,7 +962,9 @@ static int local_man_loop (const char *a
|
||||
@@ -968,7 +968,9 @@ static int local_man_loop (const char *a
|
||||
"executable\n");
|
||||
goto executable_out;
|
||||
}
|
||||
@ -119,7 +110,7 @@ diff -up man-db-2.6.3/src/man.c.valgrind-mem man-db-2.6.3/src/man.c
|
||||
|
||||
old_manpathlist = XNMALLOC (MAXDIRS, char *);
|
||||
memcpy (old_manpathlist, manpathlist,
|
||||
@@ -1167,14 +1169,21 @@ int main (int argc, char *argv[])
|
||||
@@ -1176,14 +1178,21 @@ int main (int argc, char *argv[])
|
||||
manp = get_manpath ("");
|
||||
printf ("%s\n", manp);
|
||||
exit (OK);
|
||||
@ -144,22 +135,18 @@ diff -up man-db-2.6.3/src/man.c.valgrind-mem man-db-2.6.3/src/man.c
|
||||
else
|
||||
free (get_manpath (NULL));
|
||||
|
||||
@@ -1350,6 +1359,14 @@ int main (int argc, char *argv[])
|
||||
@@ -1359,6 +1368,10 @@ int main (int argc, char *argv[])
|
||||
if (cwd[0])
|
||||
chdir (cwd);
|
||||
|
||||
+ if (database) {
|
||||
+ free (database);
|
||||
+ database = NULL;
|
||||
+ }
|
||||
+ if (manp) {
|
||||
+ free (manp);
|
||||
+ manp = NULL;
|
||||
+ }
|
||||
free_pathlist (manpathlist);
|
||||
free (cwd);
|
||||
free (internal_locale);
|
||||
@@ -1810,6 +1827,9 @@ static pipeline *make_roff_command (cons
|
||||
@@ -1819,6 +1832,9 @@ static pipeline *make_roff_command (cons
|
||||
pipeline_command (p, cmd);
|
||||
}
|
||||
|
||||
@ -169,7 +156,7 @@ diff -up man-db-2.6.3/src/man.c.valgrind-mem man-db-2.6.3/src/man.c
|
||||
free (page_encoding);
|
||||
return p;
|
||||
}
|
||||
@@ -2327,6 +2347,7 @@ static void format_display (pipeline *de
|
||||
@@ -2330,6 +2346,7 @@ static void format_display (pipeline *de
|
||||
htmldir);
|
||||
free (htmlfile);
|
||||
free (htmldir);
|
||||
@ -177,7 +164,7 @@ diff -up man-db-2.6.3/src/man.c.valgrind-mem man-db-2.6.3/src/man.c
|
||||
} else
|
||||
#endif /* TROFF_IS_GROFF */
|
||||
/* TODO: check format_cmd status too? */
|
||||
@@ -2498,6 +2519,7 @@ static int display (const char *dir, con
|
||||
@@ -2501,6 +2518,7 @@ static int display (const char *dir, con
|
||||
free (name);
|
||||
free_locale_bits (&bits);
|
||||
}
|
||||
@ -185,7 +172,7 @@ diff -up man-db-2.6.3/src/man.c.valgrind-mem man-db-2.6.3/src/man.c
|
||||
}
|
||||
#endif /* TROFF_IS_GROFF */
|
||||
|
||||
@@ -2564,6 +2586,7 @@ static int display (const char *dir, con
|
||||
@@ -2567,6 +2585,7 @@ static int display (const char *dir, con
|
||||
if (prompt && do_prompt (title)) {
|
||||
pipeline_free (format_cmd);
|
||||
pipeline_free (decomp);
|
||||
@ -193,7 +180,7 @@ diff -up man-db-2.6.3/src/man.c.valgrind-mem man-db-2.6.3/src/man.c
|
||||
return 0;
|
||||
}
|
||||
drop_effective_privs ();
|
||||
@@ -2690,6 +2713,7 @@ static int display (const char *dir, con
|
||||
@@ -2693,6 +2712,7 @@ static int display (const char *dir, con
|
||||
if (prompt && do_prompt (title)) {
|
||||
pipeline_free (format_cmd);
|
||||
pipeline_free (decomp);
|
||||
@ -201,7 +188,7 @@ diff -up man-db-2.6.3/src/man.c.valgrind-mem man-db-2.6.3/src/man.c
|
||||
if (local_man_file)
|
||||
return 1;
|
||||
else
|
||||
@@ -2741,6 +2765,8 @@ static int display (const char *dir, con
|
||||
@@ -2744,6 +2764,8 @@ static int display (const char *dir, con
|
||||
}
|
||||
}
|
||||
|
||||
@ -210,7 +197,7 @@ diff -up man-db-2.6.3/src/man.c.valgrind-mem man-db-2.6.3/src/man.c
|
||||
pipeline_free (format_cmd);
|
||||
pipeline_free (decomp);
|
||||
|
||||
@@ -2802,6 +2828,7 @@ static char *find_cat_file (const char *
|
||||
@@ -2805,6 +2827,7 @@ static char *find_cat_file (const char *
|
||||
*tmp = 0;
|
||||
if (is_directory (cat_dir)) {
|
||||
debug ("will try cat file %s\n", cat_file);
|
||||
@ -218,7 +205,7 @@ diff -up man-db-2.6.3/src/man.c.valgrind-mem man-db-2.6.3/src/man.c
|
||||
return cat_file;
|
||||
} else
|
||||
debug ("cat dir %s does not exist\n", cat_dir);
|
||||
@@ -3272,6 +3299,7 @@ static int try_section (const char *path
|
||||
@@ -3275,6 +3298,7 @@ static int try_section (const char *path
|
||||
}
|
||||
}
|
||||
|
||||
@ -226,7 +213,7 @@ diff -up man-db-2.6.3/src/man.c.valgrind-mem man-db-2.6.3/src/man.c
|
||||
for (np = names; np && *np; np++) {
|
||||
struct mandata *info = infoalloc ();
|
||||
char *info_buffer = filename_info (*np, info, name);
|
||||
@@ -3300,8 +3328,15 @@ static int try_section (const char *path
|
||||
@@ -3303,8 +3327,15 @@ static int try_section (const char *path
|
||||
else
|
||||
info->id = SO_MAN;
|
||||
|
||||
@ -243,7 +230,7 @@ diff -up man-db-2.6.3/src/man.c.valgrind-mem man-db-2.6.3/src/man.c
|
||||
/* Don't free info and info_buffer here. */
|
||||
}
|
||||
|
||||
@@ -3319,9 +3354,13 @@ static int display_filesystem (struct ca
|
||||
@@ -3322,9 +3353,13 @@ static int display_filesystem (struct ca
|
||||
char *title = appendstr (NULL, candp->source->name,
|
||||
"(", candp->source->ext, ")", NULL);
|
||||
if (candp->cat) {
|
||||
@ -259,7 +246,7 @@ diff -up man-db-2.6.3/src/man.c.valgrind-mem man-db-2.6.3/src/man.c
|
||||
} else {
|
||||
const char *man_file;
|
||||
char *cat_file;
|
||||
@@ -3344,6 +3383,7 @@ static int display_filesystem (struct ca
|
||||
@@ -3347,6 +3382,7 @@ static int display_filesystem (struct ca
|
||||
free (lang);
|
||||
lang = NULL;
|
||||
free (title);
|
||||
@ -267,7 +254,7 @@ diff -up man-db-2.6.3/src/man.c.valgrind-mem man-db-2.6.3/src/man.c
|
||||
|
||||
return found;
|
||||
}
|
||||
@@ -3571,6 +3611,10 @@ static int try_db (const char *manpath,
|
||||
@@ -3574,6 +3610,10 @@ static int try_db (const char *manpath,
|
||||
/* find out where our db for this manpath should be */
|
||||
|
||||
catpath = get_catpath (manpath, global_manpath ? SYSTEM_CAT : USER_CAT);
|
||||
@ -278,7 +265,7 @@ diff -up man-db-2.6.3/src/man.c.valgrind-mem man-db-2.6.3/src/man.c
|
||||
if (catpath) {
|
||||
database = mkdbname (catpath);
|
||||
free (catpath);
|
||||
@@ -3942,7 +3986,7 @@ static int man (const char *name, int *f
|
||||
@@ -3945,7 +3985,7 @@ static int man (const char *name, int *f
|
||||
|
||||
for (cand = candidates; cand; cand = candnext) {
|
||||
candnext = cand->next;
|
||||
@ -287,9 +274,9 @@ diff -up man-db-2.6.3/src/man.c.valgrind-mem man-db-2.6.3/src/man.c
|
||||
}
|
||||
|
||||
return *found ? OK : NOT_FOUND;
|
||||
diff -up man-db-2.6.3/src/mandb.c.valgrind-mem man-db-2.6.3/src/mandb.c
|
||||
--- man-db-2.6.3/src/mandb.c.valgrind-mem 2012-02-21 12:15:11.000000000 +0100
|
||||
+++ man-db-2.6.3/src/mandb.c 2013-04-05 18:19:01.425892362 +0200
|
||||
diff -up man-db-2.6.4/src/mandb.c.valgrind-mem man-db-2.6.4/src/mandb.c
|
||||
--- man-db-2.6.4/src/mandb.c.valgrind-mem 2012-02-21 12:15:11.000000000 +0100
|
||||
+++ man-db-2.6.4/src/mandb.c 2013-06-24 18:32:18.618658899 +0200
|
||||
@@ -247,7 +247,7 @@ static int xcopy (const char *from, cons
|
||||
}
|
||||
|
||||
@ -299,9 +286,9 @@ diff -up man-db-2.6.3/src/mandb.c.valgrind-mem man-db-2.6.3/src/mandb.c
|
||||
size_t in = fread (buf, 1, sizeof (buf), ifp);
|
||||
if (in > 0) {
|
||||
if (fwrite (buf, 1, in, ofp) == 0 && ferror (ofp)) {
|
||||
diff -up man-db-2.6.3/src/manp.c.valgrind-mem man-db-2.6.3/src/manp.c
|
||||
--- man-db-2.6.3/src/manp.c.valgrind-mem 2013-04-05 18:19:01.412892553 +0200
|
||||
+++ man-db-2.6.3/src/manp.c 2013-04-05 18:19:01.428892318 +0200
|
||||
diff -up man-db-2.6.4/src/manp.c.valgrind-mem man-db-2.6.4/src/manp.c
|
||||
--- man-db-2.6.4/src/manp.c.valgrind-mem 2013-06-24 18:32:18.608659018 +0200
|
||||
+++ man-db-2.6.4/src/manp.c 2013-06-24 18:32:18.619658887 +0200
|
||||
@@ -504,6 +504,7 @@ static char *get_nls_manpath (const char
|
||||
|
||||
closedir (mandir);
|
||||
@ -318,7 +305,7 @@ diff -up man-db-2.6.3/src/manp.c.valgrind-mem man-db-2.6.3/src/manp.c
|
||||
|
||||
/* Always try untranslated pages as a last resort. */
|
||||
locale_manpath = get_nls_manpath (manpathlist, "C");
|
||||
@@ -820,6 +822,11 @@ next:
|
||||
@@ -821,6 +823,11 @@ next:
|
||||
free (buf);
|
||||
buf = NULL;
|
||||
}
|
||||
@ -330,9 +317,9 @@ diff -up man-db-2.6.3/src/manp.c.valgrind-mem man-db-2.6.3/src/manp.c
|
||||
}
|
||||
|
||||
static void free_config_file (void *unused ATTRIBUTE_UNUSED)
|
||||
diff -up man-db-2.6.3/src/whatis.c.valgrind-mem man-db-2.6.3/src/whatis.c
|
||||
--- man-db-2.6.3/src/whatis.c.valgrind-mem 2012-06-18 12:23:37.000000000 +0200
|
||||
+++ man-db-2.6.3/src/whatis.c 2013-04-05 18:19:01.429892304 +0200
|
||||
diff -up man-db-2.6.4/src/whatis.c.valgrind-mem man-db-2.6.4/src/whatis.c
|
||||
--- man-db-2.6.4/src/whatis.c.valgrind-mem 2012-06-18 12:23:37.000000000 +0200
|
||||
+++ man-db-2.6.4/src/whatis.c 2013-06-24 18:32:18.620658875 +0200
|
||||
@@ -501,7 +501,7 @@ static inline int do_whatis_section (con
|
||||
|
||||
static int suitable_manpath (const char *manpath, const char *page_dir)
|
||||
|
29
man-db.spec
29
man-db.spec
@ -1,10 +1,10 @@
|
||||
%global cache /var/cache/man
|
||||
%global gnulib_ver 20120404-stable
|
||||
%global gnulib_ver 20130623
|
||||
|
||||
Summary: Tools for searching and reading man pages
|
||||
Name: man-db
|
||||
Version: 2.6.3
|
||||
Release: 6%{?dist}
|
||||
Version: 2.6.4
|
||||
Release: 1%{?dist}
|
||||
# GPLv2+ .. man-db
|
||||
# GPLv3+ .. gnulib
|
||||
License: GPLv2+ and GPLv3+
|
||||
@ -15,12 +15,6 @@ Source0: http://download.savannah.gnu.org/releases/%{name}/%{name}-%{version}.ta
|
||||
Source1: man-db.crondaily
|
||||
Source2: man-db.sysconfig
|
||||
|
||||
# resolves: #655385
|
||||
Patch0: man-db-2.5.9-sgr.patch
|
||||
# resolves: #677669
|
||||
Patch1: man-db-2.6.1-wildcards.patch
|
||||
# resolves: #693458
|
||||
Patch2: man-db-2.6.1-so-links.patch
|
||||
# resolves: #657409
|
||||
Patch3: man-db-2.6.1-locale-fallback.patch
|
||||
# resolves: #841431
|
||||
@ -42,6 +36,7 @@ Provides: bundled(gnulib) = %{gnulib_ver}
|
||||
|
||||
Requires: coreutils, grep, groff-base, gzip, less
|
||||
BuildRequires: gdbm-devel, gettext, groff, less, libpipeline-devel, zlib-devel
|
||||
BuildRequires: po4a
|
||||
|
||||
%description
|
||||
The man-db package includes five tools for browsing man-pages:
|
||||
@ -53,9 +48,6 @@ manual pages.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch0 -p1 -b .sgr
|
||||
%patch1 -p1 -b .wildcards
|
||||
%patch2 -p1 -b .so-links
|
||||
%patch3 -p1 -b .locale-fallback
|
||||
%patch4 -p1 -b .invalid-cache
|
||||
%patch5 -p1 -b .overrides
|
||||
@ -131,10 +123,23 @@ install -D -p -m 0644 %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/man-db
|
||||
%{_mandir}/man8/accessdb.8*
|
||||
%{_mandir}/man8/catman.8*
|
||||
%{_mandir}/man8/mandb.8*
|
||||
%lang(da) %{_datadir}/man/da/man*/*
|
||||
%lang(de) %{_datadir}/man/de/man*/*
|
||||
%lang(es) %{_datadir}/man/es/man*/*
|
||||
%lang(fr) %{_datadir}/man/fr/man*/*
|
||||
%lang(id) %{_datadir}/man/id/man*/*
|
||||
%lang(it) %{_datadir}/man/it/man*/*
|
||||
%lang(ja) %{_datadir}/man/ja/man*/*
|
||||
%lang(nl) %{_datadir}/man/nl/man*/*
|
||||
%lang(pl) %{_datadir}/man/pl/man*/*
|
||||
%lang(ru) %{_datadir}/man/ru/man*/*
|
||||
%lang(zh_CN) %{_datadir}/man/zh_CN/man*/*
|
||||
|
||||
%changelog
|
||||
* Tue Jun 25 2013 Peter Schiffer <pschiffe@redhat.com> - 2.6.4-1
|
||||
- resolves: #977255
|
||||
updated to 2.6.4
|
||||
|
||||
* Mon Apr 8 2013 Peter Schiffer <pschiffe@redhat.com> - 2.6.3-6
|
||||
- resolves: #948695
|
||||
fixed double free
|
||||
|
Loading…
Reference in New Issue
Block a user