summaryrefslogtreecommitdiff
path: root/src/manp.h
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2010-12-01 22:24:58 +0000
committerColin Watson <cjwatson@debian.org>2010-12-01 22:24:58 +0000
commitb50ef6b66da481db64be99e0e54bdfa7ca37a62e (patch)
treed31eb4e020f87af706774523a59a73d32c1260c0 /src/manp.h
parentf1260005c73e969eae532d45ee10648b672c608c (diff)
Improve .so searching (Debian bug #503472).
* src/Makefile.am (zsoelim_SOURCES): Add manp.c and manp.h. * src/zsoelim.l (zsoelim_parse_file): Take manpathlist and parent_path arguments, and save those to pass on to zsoelim_open_file. (try_compressed): New function, split out from zsoelim_open_file. (zsoelim_open_file): Take manpathlist and parent_path arguments. Rearrange search logic as follows: (1) if there is no parent_path, try opening directly; (2) look up filename within each manpath entry, treating filenames without directory parts as full manual page lookups; (3) if there is a parent_path, try opening directly. (zsoelim_stdin): Pass path and manpathlist from input data to zsoelim_open_file and zsoelim_parse_file. (zsoelim_stdin_data_new, zsoelim_stdin_data_free): New functions. * src/zsoelim.h (zsoelim_open_file, zsoelim_parse_file): Update prototypes. (zsoelim_stdin_data_new, zsoelim_stdin_data_free): Add prototypes. * src/zsoelim_main.c (main): Initialise locale and manpath. Pass manpath to zsoelim_open_file and zsoelim_parse_file. * src/man.c (main): Calculate manpath before handling -l option. (make_roff_command): Pass dir and manpathlist to zsoelim_stdin. * src/tests/zsoelim-1: New test. * src/tests/Makefile.am (ALL_TESTS): Add zsoelim-1. * NEWS: Document this. * src/manp.c (get_def): If not setuid, make this identical to get_def_user. * src/manp.h (get_def): Likewise.
Diffstat (limited to 'src/manp.h')
-rw-r--r--src/manp.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/manp.h b/src/manp.h
index 08929fea..284e606e 100644
--- a/src/manp.h
+++ b/src/manp.h
@@ -42,6 +42,10 @@ extern char *get_mandb_manpath (void);
extern char *get_catpath (const char *name, int cattype);
extern int is_global_mandir (const char *dir);
extern void read_config_file (int optional);
+#ifdef SECURE_MAN_UID
extern const char *get_def (const char *thing, const char *def);
+#else /* !SECURE_MAN_UID */
+#define get_def(thing, def) get_def_user ((thing), (def))
+#endif /* SECURE_MAN_UID */
extern const char *get_def_user (const char *thing, const char *def);
extern const char **get_sections (void);