dfa: move nalloc to position_set structure

* src/dfa.c (position_set): Add alloc.
(alloc_position_set): Initialize it.
(dfaanalyze): Use it instead of the nalloc array or nelem.
dfa: change position_set nelem to size_t

* src/dfa.c (REALLOC_IF_NECESSARY): Disable assertion, to avoid
warnings from -Wtype-limits.
(position_set): Change nelem to a size_t.
dfa: automatically resize position_sets

* src/dfa.c (insert, copy, merge): Resize arrays here.
(dfaanalyze): Do not track number of allocated elements here.
(dfastate): Allocate mbps with only one element.
dfa: fix rebase conflict

* src/dfa.c (dfaanalyze): Fix reference to nalloc.
dfa: fix incorrect comment

* src/dfa.c (dfastate): Fix comment for newline.
deprecate the --mmap option

* src/main.c (main): Deprecate the --mmap option: issue a warning
when it is used.
(usage): Change description.
* doc/grep.texi (Other Options): Document the new behavior.
* NEWS (Changes in behavior): Mention it.
tests: adjust test to match code, now that --mmap writes to stderr

* tests/ignore-mmap: Separate stdout and stderr; test both.
grep: with no args, search "." only if command-line -r

* NEWS: Document this.
* doc/grep.texi (Environment Variables, grep Programs): Likewise.
* src/main.c (usage): Likewise.
(main): Implement this.
(prepend_default_options): Return a count of prepended options.
* tests/r-dot: Test the above.
doc: document empty pattern better

* doc/grep.texi (Top, Fundamental Structure, Usage):
Explain how grep deals with the empty pattern.
Problem spotted by Bernhard Voelker in
<http://lists.gnu.org/archive/html/bug-grep/2012-01/msg00050.html>.
dfa: non-glibc word-constituent unibyte fix

* src/dfa.c (is_valid_unibyte_character): Fix typo that caused
this to incorrectly return 0 on unibyte non-glibc systems.
Problem reported by Aharon Robbins in
<http://lists.gnu.org/archive/html/bug-grep/2012-01/msg00084.html>.
grep: don't say "write error" over and over

Problem reported by Travis Gummels in
<https://bugzilla.redhat.com/show_bug.cgi?id=741452>.
* src/main.c (write_error_seen): New static var.
(clean_up_stdout): New function.
(prline): Do not output 'write error' more than once; exit
after the first one.  Use the same wording for the diagnostic
that close_stdout uses.
(main): Clean up with clean_up_stdout, not close_stdout, so that
grep doesn't output multiple "write error" diagnostics.
* tests/Makefile.am (TESTS): Add epipe.
* tests/epipe: New file.
grep: suppress read errors if -s

* src/main.c (reset, grep, grepfile): Do not report an input error
if -s is given.
grep: exit with nonzero status if directory loop

* src/main.c (grepdir): Exit with status 2 if a directory loop is
found, since the output might not be "right" (i.e., infinite...).
grep: be quiet about GREP_COLORS syntax

* src/main.c (struct color_cap): fct now returns void,
since there's no longer need to use what it returns.
(color_cap_mt_fct, color_cap_rv_fct, color_cap_ne_fct): Return void.
(parse_grep_colors): Do not output diagnostics and then exit with
status 0.  Instead, ignore errors in GREP_COLORS.  This is more
consistent with programs that (e.g.) ignore errors in termcap entries,
and it's more internally-consistent as some GREP_COLORS errors
were ignored but not others.
doc: document recent diagnostics-related changes

* NEWS: Document changes re diagnostics related to GREP_COLORS,
directory loops, -s, "write error".
build: update gnulib to latest; adjust quoting in tests

* gnulib: Update.
* tests/in-eq-out-infloop: Convert expected diagnostics to match
new quoting.
maint: convert `this' to 'this' quoting style in diagnostics

Now that gnulib's quote and quotearg modules use 'this' style,
change the few explicit uses in diagnostics to conform.
* src/egrep.c (after_options): Use 'this' style of quotes.
* src/fgrep.c (after_options): Likewise.
* src/grep.c (after_options): Likewise.
* src/main.c (usage): Likewise.
build: update bootstrap from gnulib and adapt

* bootstrap: Update from gnulib.
* tests/init.sh: Update from gnulib.
* bootstrap.conf (bootstrap_epilogue): Remove now-unnecessary,
snippet that edited gnulib-tests/gnulib.mk.
(gnulib_tool_option_extras): Add both --symlink and
--makefile-name=gnulib.mk.  Remove use of $bt.
* lib/Makefile.am: Initialize numerous automake variables so that
generated code in gnulib.mk may use += to append to them.
dfa: remove useless check

* src/dfa.c (state_index): There is nothing that is a newline *and*
a letter.  Remove redundant call to SUCCEEDS_IN_CONTEXT.
dfa: introduce contexts for the values in d->success

Also initialize all tables in a single place in dfasyntax.

* src/dfa.c (CTX_NONE, CTX_LETTER, CTX_NEWLINE, char_context): New.
(sbit, letters, newline): New.
(dfasyntax): Fill them.
(dfastate): Remove letters, newline, initialized.
(build_state): Use CTX_* constants.
(dfaexec): Remove sbit and sbit_init.