summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
* * src/man.c (local_man_loop): Simplify and improve code to make aColin Watson2010-11-15
| | | | temporary copy of manpathlist, in order that it can't free unallocated memory (may fix Savannah bug #31633).
* Prevent repeated rescans when a link is broken.Colin Watson2010-11-14
| | | | | | | | | | | * src/check_mandirs.c (test_manfile): Explicitly delete bad links from the database. (count_glob_matches, purge_whatis, purge_missing): Extract the database mtime, and ignore any pages at least as old as that for the purposes of deciding whether a whatis entry has been replaced by a real page. * src/tests/mandb-3: New test. * src/tests/Makefile.am (ALL_TESTS): Add mandb-3. * NEWS: Document this.
* * src/catman.c (parse_for_sec): Explicitly pass -S before sectionColin Watson2010-11-03
| | | | | | number, to reduce ambiguity. * src/man.c (main): In catman mode, never try to guess whether a page argument is a section, as it's too easy to get this wrong (Ubuntu bug #664211).
* * lib/pipeline.c (pipeline_new): Default ignore_signals to 0.Colin Watson2010-10-29
| | | | | | | | * lib/decompress.c (decompress_open, decompress_fdopen): Remove redundant calls to pipeline_ignore_signals. * src/man.c (make_browser): Explicitly ignore SIGINT and SIGQUIT when running the browser. (make_display_command): Explicitly ignore SIGINT and SIGQUIT when running the pager.
* * lib/pipeline.c, lib/pipeline.h: Rename command to pipecmd,Colin Watson2010-10-29
| | | | command_* to pipecmd_*, and COMMAND_* to PIPECMD_*. Update all callers.
* * lib/pipeline.c (pipeline_install_post_fork): New function.Colin Watson2010-10-25
| | | | | | | | | | (pipeline_start): Call post-fork handler rather than hardcoding pop_all_cleanups. * lib/pipeline.h (pipeline_install_post_fork): Add prototype. * src/lexgrog_test.c (main), src/man.c (main), src/manconv_main.c (main), src/mandb.c (main), src/whatis.c (main), src/zsoelim_main.c (main): Install pop_all_cleanups as a post-fork handler.
* Allow building with an external libpipeline.Colin Watson2010-10-24
| | | | | | | | | * configure.ac: Add --with-external-pipeline option. * lib/Makefile.am (libman_la_CPPFLAGS): Add $(libpipeline_CFLAGS). (libman_la_SOURCES): Include pipeline.c and pipeline.h only conditionally. (libman_la_LDFLAGS): Add $(libpipeline_LIBS). * src/Makefile.am (AM_CPPFLAGS): Add $(libpipeline_CFLAGS). * NEWS: Document this.
* Make command and pipeline opaque types.Colin Watson2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/pipeline.c (command_nice, command_discard_err, pipeline_get_ncommands, pipeline_get_command, pipeline_set_command, pipeline_want_in, pipeline_want_out, pipeline_want_infile, pipeline_want_outfile, pipeline_ignore_signals): New functions. * lib/pipeline.h (command_nice, command_discard_err, pipeline_get_ncommands, pipeline_get_command, pipeline_set_command, pipeline_want_in, pipeline_want_out, pipeline_want_infile, pipeline_want_outfile, pipeline_ignore_signals): Add prototypes. * lib/pipeline.h (enum command_tag, struct command_env, struct command, struct pipeline): Move to ... * lib/pipeline.c (enum command_tag, struct command_env, struct command, struct pipeline): ... here. Redirections are now handled slightly differently internally, allowing redirection from/to fd 0. * lib/pipeline.c (pipeline_new, pipeline_join): Set redirect_in and redirect_out. (pipeline_connect): Use pipeline_want_in and pipeline_want_out. Check source->redirect_out. (pipeline_start): Handle new redirection semantics. * lib/decompress.c (decompress_open, decompress_fdopen): Use new accessor functions rather than accessing pipeline fields directly. * src/man.c (make_display_command, discard_stderr, open_cat_stream, format_display, display_catman, display): Likewise.
* * lib/pipeline.c (pipeline_run): This would be a more convenientColin Watson2010-10-24
| | | | | | | | | | | wrapper for the common case if it freed the pipeline as well, so do that. (Callers that don't want this should call pipeline_start and pipeline_wait separately.) * lib/pipeline.h (pipeline_run): Update comment. * lib/security.c (do_system_drop_privs): Consistently free the supplied pipeline, and document doing so. * src/man.c (format_display): Remove pipeline_free after do_system_drop_privs. * src/whatis.c (use_grep): Remove pipeline_free after pipeline_run.
* * lib/pipeline.c (pipeline_new_command_args): New function.Colin Watson2010-10-24
| | | | * lib/pipeline.h (pipeline_new_command_args): Add prototype. * src/man.c (make_browser): Use it.
* * lib/pipeline.c (pipeline_run): New function.Colin Watson2010-10-24
| | | | | | * lib/pipeline.h (pipeline_run): Add prototype. * lib/security.c (do_system_drop_privs): Use it. * src/man.c (do_extern, run_mandb): Likewise. * src/whatis.c (use_grep): Likewise.
* * lib/util.c (init_locale): New function.Colin Watson2010-10-12
| | | | | | | | | | | | | * include/manconfig.h.in (init_locale): Add prototype. * src/Makefile.am (AM_CPPFLAGS): Move -DLOCALEDIR to ... * lib/Makefile.am (libman_la_CPPFLAGS): ... here. * src/accessdb.c (main), src/catman.c (main), src/globbing_test.c (main), src/lexgrog_test.c (main), src/man.c (main), src/manconv_main.c (main), src/mandb.c (main), src/manpath.c (main), src/whatis.c (main), src/zsoelim.c (main): Use init_locale. * lib/util.c (init_locale): Suppress warning message if DPKG_RUNNING_VERSION is set in the environment. * NEWS: Document this.
* It turns out that AM_GNU_GETTEXT([use-libtool]) is unsupported.Colin Watson2010-10-05
| | | | | | | | | | | | | | | | | | | Switch to external libintl instead. * configure.ac (AM_GNU_GETTEXT): Set external. (AC_CONFIG_FILES): Remove intl/Makefile. * Makefile.am (SUBDIRS): Remove intl. (EXTRA_DIST): Add gnulib/m4/glibc2.m4, gnulib/m4/intdiv0.m4, gnulib/m4/intl.m4, gnulib/m4/intmax.m4, gnulib/m4/inttypes-pri.m4, gnulib/m4/lcmessage.m4, gnulib/m4/printf-posix.m4, gnulib/m4/uintmax_t.m4, and gnulib/m4/visibility.m4. * intl: Remove. * lib/Makefile.am (libman_la_CPPFLAGS): Remove -I$(top_builddir)/intl. * libdb/Makefile.am (libmandb_la_CPPFLAGS): Likewise. * src/Makefile.am (AM_CPPFLAGS): Likewise. * .bzrignore: Remove intl/Makefile, intl/charset.alias, intl/libgnuintl.h, intl/libintl.h, intl/ref-add.sed, and intl/ref-del.sed. * NEWS: Document this.
* * lib/Makefile.am (libman_la_LIBADD): Include @LTLIBINTL@ ratherColin Watson2010-10-05
| | | | | than @LIBINTL@. * src/Makefile.am (whatis_LDADD): Include $(LTLIBICONV) rather than $(LIBICONV).
* * lib/pipeline.c (command_argf): New function.Colin Watson2010-10-03
| | | | | | * lib/pipeline.h (command_argf): Add prototype. * src/man.c (add_roff_line_length): Use it, reducing need for temporary local variables. (make_roff_command): Likewise.
* * src/man.c (setenv_less): Take a command argument. Set environmentColin Watson2010-10-03
| | | | | variables only for that command, not globally. (make_display_command): Call setenv_less on the command constructed from pager.
* * lib/pipeline.c (reap_children, pipeline_sigchld,Colin Watson2010-10-03
| | | | | | | | | | | | pipeline_install_sigchld): Move above pipeline_start. (pipeline_install_sigchld): Make static. Return immediately if already installed. (pipeline_start): Call pipeline_install_sigchld. * lib/pipeline.h (pipeline_start): Document that this installs a SIGCHLD handler. (pipeline_install_sigchld): Remove prototype. * src/lexgrog_test.c (main), src/man.c (main), src/manconv_main.c (main), src/mandb.c (main), src/whatis.c (main), src/zsoelim_main.c (main): Stop calling pipeline_install_sigchld.
* Move util to libman.Colin Watson2010-09-27
| | | | | | | | | * src/util.c: Move to ... * lib/util.c: ... here. * lib/Makefile.am (libman_la_SOURCES): Add util.c. * src/Makefile.am (accessdb_SOURCES, catman_SOURCES, globbing_SOURCES, lexgrog_SOURCES, man_SOURCES, mandb_SOURCES, manpath_SOURCES, whatis_SOURCES, zsoelim_SOURCES): Remove util.c. * lib/README: Add util.c.
* * gnulib/m4/gnulib-cache.m4: Remove obsolete modules atexit, memcmp,Colin Watson2010-09-27
| | | and strcspn.
* Move security to libman.Colin Watson2010-09-27
| | | | | | | | | | | | | | | | | | | | | * src/security.c: Move to ... * lib/security.c: ... here. * src/security.h: Move to ... * lib/security.h: ... here. * lib/Makefile.am (libman_la_SOURCES): Add security.c and security.h. * src/Makefile.am (lexgrog_SOURCES): Remove fake_security.c and security.h. (man_SOURCES, mandb_SOURCES): Remove security.c and security.h. * lib/README: Add security.*. * src/lexgrog_test.c: Call init_security, so that we can use generic security functions rather than fake_security. * src/fake_security.c: Remove. * lib/security.c (do_system_drop_privs): Unroll calls to do_system into calls to pipeline_start and pipeline_wait. * src/whatis.c (use_grep): Likewise. * src/util.c (do_system): Remove. * include/manconfig.h.in (do_system): Remove. * src/*.c: Update #include grouping for movements to libman.
* Get the tests working again following the switch to libtool.Colin Watson2010-09-26
| | | | | | | | | | | | | * src/tests/Makefile.am (TESTS_ENVIRONMENT): Remove CLEANPATH. * src/tests/man-1, src/tests/mandb-1, src/tests/mandb-2: Set MANPATH rather than using run_clean_path; running with a stripped-down PATH is risky in general and breaks libtool in particular. * src/tests/testlib.sh (run_clean_path): Remove. * src/tests/Makefile.am (TESTS_ENVIRONMENT): Add top_builddir. * src/tests/testlib.sh (run): New function. * src/tests/lexgrog-1, src/tests/man-1, src/tests/manconv-1, src/tests/manconv-2, src/tests/manconv-3, src/tests/mandb-1, src/tests/mandb-2, src/tests/testlib.sh (accessdb_filter): Use run when running programs from the build tree.
* Move encodings to libman.Colin Watson2010-09-26
| | | | | | | | | | | | * src/encodings.c: Move to ... * lib/encodings.c: ... here. * src/encodings.h: Move to ... * lib/encodings.h: ... here. * lib/Makefile.am (libman_la_SOURCES): Add encodings.c and encodings.h. * src/Makefile.am (lexgrog_SOURCES, man_SOURCES, manconv_SOURCES, mandb_SOURCES, manpath_SOURCES): Remove encodings.c and encodings.h. * lib/README: Add encodings.*.
* * src/encodings.c (struct manconv_codes, manconv_stdin,Colin Watson2010-09-26
| | | | | | | | | | | free_manconv_codes, add_manconv): Move to ... * src/manconv_client.c: ... here (new file). * src/encodings.h (add_manconv): Move to ... * src/manconv_client.h: ... here (new file). * src/lexgrog.l, src/man.c, src/straycats.c: Include manconv_client.h. * src/Makefile.am (lexgrog_SOURCES, man_SOURCES, mandb_SOURCES): Add manconv_client.c and manconv_client.h. * src/manp.c: Remove unnecessary inclusion of encodings.h.
* * src/compression.c: Remove unnecessary inclusion of security.h.Colin Watson2010-09-26
| | | * src/ult_src.c: Likewise.
* * src/manp.c (mkcatdirs): Move to ...Colin Watson2010-09-26
| | | | | | | * src/check_mandirs.c (mkcatdirs): ... here, as it's only used by testmandirs. Removes dependency of manp.c on security.h. * src/manp.h (mkcatdirs): Remove prototype. * src/Makefile.am (catman_SOURCES, manpath_SOURCES, whatis_SOURCES): Remove fake_security.c.
* * src/security.c (remove_with_dropped_privs): Remove; no longerColin Watson2010-09-26
| | | | | used. * src/fake_security.c (remove_with_dropped_privs): Likewise. * src/security.h (remove_with_dropped_privs): Likewise.
* Build libman and libmandb as shared libraries, reducing ourColin Watson2010-09-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | installed footprint by about 200K. * configure.ac: Add LT_INIT. Move AC_GNU_SOURCE up to above it. Remove redundant AC_PROG_RANLIB. * gnulib/m4/gnulib-cache.m4: Enable libtool support. * gnulib/m4/libtool.m4, gnulib/m4/ltoptions.m4, gnulib/m4/ltsugar.m4, gnulib/m4/ltversion.m4, gnulib/m4/lt~obsolete.m4, tools/ltmain.sh: New files, created by libtoolize. * autogen.sh: Export LIBTOOLIZE_OPTIONS=--quiet. * lib/Makefile.am: Switch to libtool. Add ../gnulib/lib/libgnu.la, $(LIBCOMPRESS), and @LIBINTL@ to LIBADD. Install the library in $(pkglibdir), and instruct libtool to set an RPATH on binaries built against this library. * libdb/Makefile.am: Switch to libtool. Add ../lib/libman.la to LIBADD. Install the library in $(pkglibdir), and instruct libtool to set an RPATH on binaries built against this library. * src/Makefile.am (LIBMAN): Reduce to libman. (LIBMANDB): Reduce to libmandb. (accessdb_LDADD, catman_LDADD, globbing_LDADD, lexgrog_LDADD, man_LDADD, manconv_LDADD, mandb_LDADD, manpath_LDADD, whatis_LDADD, zsoelim_LDADD): Remove dependencies of libman and libmandb. * .bzrignore: Add **/*.la, **/*.lo, **/.libs, and ./libtool. * NEWS: Document this. Avoid symbol clashes between libgnu and libman. * lib/hashtable.c (null_hash_free, plain_hash_free, hash_create, hash_lookup_structure, hash_lookup, hash_install, hash_remove, hash_free): Rename to ... (null_hashtable_free, plain_hashtable_free, hashtable_create, hashtable_lookup_structure, hashtable_lookup, hashtable_install, hashtable_remove, hashtable_free): ... these. Update all callers and prototypes. * lib/hashtable.h (hash_free_ptr): Rename to ... (hashtable_free_ptr): ... this. Update all users.
* * src/man.c (display_catman): Add iconv to format_cmd before addingColin Watson2010-08-17
| | | | a compressor. * NEWS: Document this.
* * src/man.c (add_output_iconv): Make static.Colin Watson2010-08-17
|
* Upgrade to Gnulib 20100704.Colin Watson2010-07-20
| | | * configure.ac (AM_GNU_GETTEXT_VERSION): Upgrade to gettext 0.18.1.
* * src/descriptions.c (parse_descriptions): Free record.Colin Watson2010-05-19
| | | | | * src/encodings.c (check_preprocessor_encoding): Free directive. (manconv_stdin): Free p. * src/lexgrog_test.c (main): Free lg.filters and lg.whatis.
* * src/filenames.c (filename_info): Explicitly fail if the extensionColin Watson2010-05-08
| | | is zero-length.
* * src/filenames.c (filename_info): Allow section and extension toColin Watson2010-05-08
| | | | | differ as long as the first character is the same. (This is my understanding of what the code was originally meant to do, but it only worked if the section was exactly one character long.)
* Upgrade to Gnulib 20100424.Colin Watson2010-04-27
|
* Fix build regression when GNU_NROFF is undefined (Savannah bugColin Watson2010-03-24
| | | | | | | | | | #29318). * src/man.c (add_col): New function, split out from make_display_command. (make_roff_command): Reinstate tbl/col logic here, as by the time we get to make_display_command we've forgotten whether tbl was used. (make_display_command): Remove tbl/col logic, useless here. Use add_col.
* * src/man.c (main): Try underscore-separated subpages as well asTanguy Ortolo2010-03-21
| | | | | hyphen-separated ones (Debian bug #574641). * man/man1/man.man1 (Finding manual pages): Document this. * NEWS: Document this.
* * gnulib: Import localcharset module.Colin Watson2010-03-17
| | | | | | | | | | | | | * src/encodings.c (struct charset_entry): Rename locale_charset to charset_from_locale. Update all users. (struct less_charset_entry): Likewise. (get_locale_charset): Use locale_charset function from Gnulib, rather than dealing with nl_langinfo and the fallback ourselves. (get_default_device): Rename locale_charset parameter to charset_from_locale. (get_less_charset): Likewise. (get_jless_charset): Likewise. * src/tests/Makefile.am (TESTS_ENVIRONMENT): Add @LOCALCHARSET_TESTS_ENVIRONMENT@.
* Upgrade to Gnulib 20100308.Colin Watson2010-03-13
|
* * configure.ac: Add AM_MAINTAINER_MODE. In the modern world,Colin Watson2010-03-11
| | | | timestamps are often just too fragile for those make targets to work well; use ./autogen.sh instead.
* Add support for XZ-compressed manual pages (Debian bug #572233).Darren Salt2010-03-03
| | | | | | * configure.ac: Check for xz. * include/comp_src.h.in (comp_list): Add xz. * include/manconfig.h.in: Define UNXZ. * NEWS: Document this.
* Fix assertion failure on 'man -l' with an uncompressed page andColin Watson2010-03-02
| | | | | | | | | | | prefixed input (no-hyphenation, no-justification, or a non-English page). * lib/pipeline.c (command_new_passthrough): New function. * lib/pipeline.h (command_new_passthrough): Add prototype. * src/man.c (display): Allow zero-command decompression pipelines with prefix sequences. In that case, append a passthrough command to the prefix sequence, and append the prefix sequence to the decompression pipeline rather than replacing its first command. * NEWS: Document this.
* * src/man.c (locale_macros): Explicitly set groff's hyphenationColin Watson2010-02-18
| | | | language, to ensure that it only hyphenates languages it knows about (Debian bug #570247).
* * src/manp.c (get_catpath): Fix handling of non-translated catColin Watson2010-02-16
| | | paths.
* Always save cat pages in UTF-8 (Debian bug #446741).Colin Watson2010-02-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | * src/encodings.c (struct directory_entry): Remove standard_output_encoding member. (directory_table): Likewise. (get_standard_output_encoding): Remove. * src/encodings.h (get_standard_output_encoding): Remove prototype. * src/man.c (my_locale_charset): New function, with code moved from make_roff_command. (make_roff_command): Return pipeline output encoding in a new output parameter. Remove enforcement that cat pages could only be saved for the manual hierarchy's default character set. Move post-cat-page pipeline elements to ... (add_output_iconv, make_display_command): ... here. (make_display_command): Remove code for handling a named input file, which has been unused for some time. New encoding argument. (open_cat_stream): New encoding argument. Convert from it to UTF-8 while saving the cat page. (format_display_and_save): New encoding argument, passed to open_cat_stream. (display_catman): New encoding argument. Convert from it to UTF-8 while saving the cat page. (display): Get formatted encoding from make_roff_command and pass it to display_catman, make_display_command, and format_display_and_save. Assume UTF-8 when displaying an existing cat page. * NEWS: Document this.
* * src/manp.c (get_catpath): Handle man -> cat substitution correctlyColin Watson2010-02-08
| | | for translated cat pages.
* * src/man.c (format_display_and_save): Use sigaction, not signal.Colin Watson2010-02-08
|
* * src/manconv.c (try_iconv): Don't lose iconv errors from convertingColin Watson2010-01-31
| | | to UTF-8 when the target encoding is not UTF-8.
* Upgrade to Automake 1.11.1 and Gnulib 20100109.Colin Watson2010-01-31
|
* * src/whatis.c (search): "%s: nothing appropriate." is an error;Colin Watson2010-01-14
| | | write it to stderr, not stdout (Debian bug #565255).
* autogenColin Watson2010-01-13
|