aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/read.c
Commit message (Collapse)AuthorAgeFilesLines
* merge revision 1.161: resolve trivial differences with OpenBSDIngo Schwarze2017-02-181-4/+4
|
* merge rev.s 1.159 and 1.160: gzip bugfix and struct mparse cleanupIngo Schwarze2017-02-031-7/+8
|
* merge rev. 1.158: new sentence, new lineIngo Schwarze2017-01-281-1/+2
|
* merge rev. 1.157: new function mparse_updaterc()Ingo Schwarze2017-01-091-1/+8
|
* merge rev.s 1.155 and 1.156: changes to the message catalogueIngo Schwarze2017-01-091-3/+5
|
* merge rev. 1.154: improve message "whitespace at end of input line"Ingo Schwarze2017-01-091-2/+4
|
* merge rev. 1.153: warn about trailing whitespace at the end of commentsIngo Schwarze2016-11-101-6/+12
|
* merge ".Bl -tag without -width" fix to 1.13 branchIngo Schwarze2016-10-181-2/+8
|
* Remove the dependency on SQLite without loss of functionality.Ingo Schwarze2016-07-191-7/+1
| | | | | Stop supporting systems that don't have mmap(3). Drop the obsolete names_check() now that we deleted MLINKS.
* Since the mdoc/man parser unification, the parser is always allocatedIngo Schwarze2016-07-191-25/+3
| | | | | | in mparse_alloc(), so delete all the curp->man == NULL checks. Triggered by a patch from Christos Zoulas suggesting to add yet another such check.
* Fix a nasty typo that prevented .so links to gziped manualsIngo Schwarze2016-07-101-2/+2
| | | | | from working in the absence of a mandoc.db(5) database. Found the hard way by Svyatoslav Mishyn on Crux Linux.
* Simplify the mparse_open() interface.Ingo Schwarze2016-01-081-12/+12
| | | | | | Just return the file descriptor or -1 on error; there is just one kind of error anyway. Suggested by Christos Zoulas (NetBSD).
* It was very surprising that a function called mparse_readfd()Ingo Schwarze2016-01-081-5/+2
| | | | | | | | | | | | | closed the file descriptor passed to it after completing its work, in particular considering the fact that it required its callers to call open(2) or mparse_open() beforehand. Change mparse_readfd() to not call close(2) and change the callers to call close(2) afterwards, more or less bringing open and close to the same level of the code and making review easier. Note that man.cgi(8) already did that, even though it was wrong in the past. Small restructuring suggested by Christos Zoulas (NetBSD).
* Without HAVE_ERR, don't try to include <err.h>, it probably isn't there.Ingo Schwarze2015-11-071-1/+3
| | | | | In that case, the required prototypes are in "config.h". Patch from Peter Bray <pdb_ml at yahoo dot com dot au>.
* If a .Bd block has no arguments at all, drop the block and only keepIngo Schwarze2015-10-301-1/+2
| | | | | its contents. Removing a gratuitious difference to groff output found after a related bug report from krw@.
* Major character table cleanup:Ingo Schwarze2015-10-131-5/+3
| | | | | | | | | | | | | * Use ohash(3) rather than a hand-rolled hash table. * Make the character table static in the chars.c module: There is no need to pass a pointer around, we most certainly never want to use two different character tables concurrently. * No need to keep the characters in a separate file chars.in; that merely encourages downstream porters to mess with them. * Sort the characters to agree with the mandoc_chars(7) manual page. * Specify Unicode codepoints in hex, not decimal (that's the detail that originally triggered this patch). No functional change, minus 100 LOC, and i don't see a performance change.
* Finally use __progname, err(3) and warn(3).Ingo Schwarze2015-10-111-13/+9
| | | | | | | | | | That's more readable and less error-prone than fumbling around with argv[0], fprintf(3), strerror(3), perror(3), and exit(3). It's a bad idea to boycott good interfaces merely because standards committees ignore them. Instead, let's provide compatibility modules for archaic systems (like commercial Solaris) that still don't have them. The compat module has an UCB Copyright (c) 1993...
* modernize style: "return" is not a functionIngo Schwarze2015-10-061-14/+14
|
* Remove the warning about children of .Vt blocks because actually,Ingo Schwarze2015-09-141-2/+1
| | | | | | | .Vt type global_variable No = Dv defined_constant ; is the best way to specify in the SYNOPSIS how a global variable is initialized in the rare case where that matters. Issue noticed by jmc@.
* Do not fork and exec gunzip(1), just link with libz instead.Ingo Schwarze2015-07-191-83/+33
| | | | | | | As discussed with deraadt@, that's cleaner and will help tame(2). Something like this was also suggested earlier by bapt at FreeBSD. Minus 50 lines of code, deleting one interface function (mparse_wait), no functional change intended.
* Unify some node handling functions that use TOKEN_NONE.Ingo Schwarze2015-04-191-12/+7
| | | | | | | | * mdoc_word_alloc(), man_word_alloc() -> roff_word_alloc() * mdoc_word_append(), man_word_append() -> roff_word_append() * mdoc_addspan(), man_addspan() -> roff_addtbl() * mdoc_addeqn(), man_addeqn() -> roff_addeqn() Minus 50 lines of code, no functional change.
* Decouple the token code for "no request or macro" from the individualIngo Schwarze2015-04-191-6/+5
| | | | | | high-level parsers to allow further unification of functions that only need to recognize this code, but that don't care about different high-level macrosets beyond that.
* Unify {mdoc,man}_{alloc,reset,free}() into roff_man_{alloc,reset,free}().Ingo Schwarze2015-04-181-39/+25
| | | | | Minus 80 lines of code, no functional change. Written on the train from Koeln to Wolfsburg returning from p2k15.
* Move mdoc_hash_init() and man_hash_init() to libmandoc.hIngo Schwarze2015-04-181-3/+9
| | | | | and call them from mparse_alloc() and choose_parser(), preparing unified allocation of struct roff_man.
* Profit from the unified struct roff_man and reduce the number ofIngo Schwarze2015-04-181-52/+40
| | | | | arguments of mparse_result() by one. No functional change. Written on the ICE Bruxelles-Koeln on the way back from p2k15.
* Replace the structs mdoc and man by a unified struct roff_man.Ingo Schwarze2015-04-181-7/+7
| | | | | Almost completely mechanical, no functional change. Written on the train from Exeter to London returning from p2k15.
* First step towards parser unification:Ingo Schwarze2015-04-021-5/+6
| | | | | | Replace enum mdoc_type and enum man_type by a unified enum roff_type. Almost mechanical, no functional change. Written on the ICE train from Frankfurt to Bruxelles on the way to p2k15.
* When the user exits the pager before the pager has drained all inputIngo Schwarze2015-03-171-1/+3
| | | | | | | | from man(1), man(1) dies from SIGPIPE. Exiting man(1) is fine in this case, generating more output would be pointless, but without handling SIGPIPE, the exit code from man(1) was wrong and csh(1) printed an ugly message "Broken pipe". Fix this by handling SIGPIPE explicitly. Issue noticed by deraadt@.
* Fix previous: size_t is often narrower than off_t.Ingo Schwarze2015-03-111-2/+2
| | | | Cluestick applied by joerg at NetBSD.
* The st_size member of struct stat is off_t, which is signed,Ingo Schwarze2015-03-101-2/+2
| | | | | all required by POSIX. So don't compare it against against an unsigned constant.
* If a non-gz manual is read after a gzipped manual, refrainIngo Schwarze2015-03-021-1/+2
| | | | | | from throwing a bogus error "wait: No child processes". As reported by Baptiste Daroussin <bapt at FreeBSD dot org>, clearing the state variable curp->child after use was forgotten.
* improve NAME section diagnostics;Ingo Schwarze2015-02-231-2/+5
| | | | confusing messages reported by Jan Stary <hans at stare dot cz>
* Completely delete all carriage return characters from the input.Ingo Schwarze2015-02-201-2/+3
| | | | | | | No change to messages about them (ignore them right before line feeds, report errors elsewhere). naddy@ found a manual in the wild containing lots of these (ysm(1)), and i can't imagine a situation where dropping them could be problematic.
* replace the last legacy generic message type, "argument count wrong",Ingo Schwarze2015-02-061-2/+3
| | | | by more specific messages, improving diagnostics for .cc .tr .Bl -column
* better error reporting regarding .OP .RS .UR .TH argumentsIngo Schwarze2015-02-061-1/+3
|
* Delete the legacy generic warning type MANDOCERR_ARGCWARN,Ingo Schwarze2015-02-061-2/+2
| | | | | replacing the last instances by more specific warnings. Improved functionality, minus 50 lines of code.
* better handle .Fo and .Fd without argumentIngo Schwarze2015-02-061-1/+2
| | | | better handle .Fo with more than one argument
* discard .Rs head arguments and improve .Rs diagnosticsIngo Schwarze2015-02-041-1/+2
|
* more specific .Nd diagnostics, allowing to get rid of enum check_lvlIngo Schwarze2015-02-041-1/+2
| | | | and the respective argument of check_count()
* Clean up eqn(7) error handling:Ingo Schwarze2015-01-281-7/+1
| | | | | | | | * When "define" fails, do not drop the whole equation. * Free memory after "undef". * Use standard mandoc error types instead of rolling our own. * Delete obfuscating EQN_MSG() macro. * Add function prototypes while here.
* * Polish tbl(7) error reporting.Ingo Schwarze2015-01-281-6/+6
| | | | | | * Do not print out macro names in tbl(7) data blocks. * Like with GNU tbl, let empty tables cause a blank line. * Avoid producing empty tables in -Tman.
* Rework tbl(7) layout parsing:Ingo Schwarze2015-01-261-3/+10
| | | | | | | | | | | * Continue parsing even if part of the input is invalid. * Do not require whitespace between cell specifications. * Allow tabs as well as blanks between modifiers. * Mark the 'm' modifier as unsupported. * Parse and ignore the 'p' and 'v' modifiers. * Better warning and error messages. * Get rid of a static buffer. Improved functionality but minus 50 lines of code.
* More improvements regarding tbl(7) options.Ingo Schwarze2015-01-261-1/+2
| | | | | | | | | * Treat "allbox" as an alias for "box" for now. * Parse and ignore the GNU tbl "nowarn" option. * For separation, allow spaces, tabs, and commas only. * Mark eqn(7) within tbl(7) as unsupported. * Simplify the option table. * Improve and sort documentation.
* Improve (or rather, rewrite) tbl(7) option parsing.Ingo Schwarze2015-01-261-3/+5
| | | | | | | | | | | | * Allow the layout to start after the semicolon on the options line. * Ignore leading commas. * Option arguments cannot contain closing parentheses. * Avoid needless UNSUPP messages. * Better ERROR reporting. * Delete unused "linesize" field in struct tbl_opts. * No need for static buffers. * Garbage collect one almost empty wrapper function. Improved functionality, but minus 40 lines of code.
* Support .RE with an argument; needed for audio/pms(1).Ingo Schwarze2015-01-241-1/+2
|
* Traditional roff(7) explicitly allows certain control charactersIngo Schwarze2015-01-221-7/+9
| | | | | | | in the input stream (SOH, STX, ETX, ENQ, ACK, BEL, BS) for specific purposes (leaders, backspace, delimiters, .tr), but making sure these don't leak through to the output is tricky, so mark them as unsupported for now.
* Don't let a failing mparse_open() clobber the filename pointer;Ingo Schwarze2015-01-221-3/+7
| | | | | fixes error message content and a use after free for .so with non-existent target when -Wall or -Tlint is given.
* Split the -Werror message level into -Werror (broken manual, probablyIngo Schwarze2015-01-201-9/+13
| | | | | | | | | | | | | using mandoc is better than using groff) and -Wunsupp (manual using unsupported low-level roff(7) feature, probably using groff is better than using mandoc). Once this feature is complete, it is intended to help porting, making the decision whether to USE_GROFF easier. As a first step, distinguish four classes of roff(7) requests: 1. Supported (currently 24 requests) 2. Currently ignored because unimportant (120) -> no message 3. Ignored for good because insecure (14) -> -Werror 4. Currently unsupported (68) -> these trigger the new -Wunsupp messages
* Fatal errors no longer exist.Ingo Schwarze2015-01-151-41/+12
| | | | | | If a file can be opened, mandoc will produce some output; at worst, the output may be almost empty. Simplifies error handling and frees a message type for future use.
* downgrade .so failure from FATAL to ERRORIngo Schwarze2015-01-151-16/+18
|