Fix file truncation when switching from git diff to non-git diff

* src/patch.c (main): Output queued output files only when switching from a git
diff to a non-git diff.  This can modify the input file, so make sure to
stat() it again.
* tests/concat-git-diff: Add test case growing a file with a git diff and then
with a non-git diff; without this fix; the result would be truncated.
Document command-line options in alphabetic order

* patch.man: The options are mostly listen in alphabetical order; stick to
that.
Use stat where we want to follow symlinks

* src/pch.c (prefix_components): Follow symlinks.
(cwd_is_root): Follow symlinks.
Introduce function to lstat all input files

* src/util.c (stat_file): New function.
(move_file): Use here.
* src/util.h (stat_file): Declare here.
* src/inp.c (get_input_file): Use here.
* src/patch.c (main): Use here.
(delete_file_later): Use here.
* src/pch.c (there_is_another_patch): Use here.
(intuit_diff_type): Use here.
Add --follow-symlinks option for backwards compatibility

* src/common.h (follow_symlinks): New variable.
* src/patch.c (longopts): Add new --follow-symlinks option.
(get_some_switches): Recognize the new option.
* src/util.c (stat_file): Follow symlinks if requested.
* patch.man: Document the new option.
* tests/symlinks: Add test case.
Add a missing explanation in the tests/crlf-handling test case

* tests/crlf-handling: Add explanation.
Ignore when preserving extended attributes is not supported or allowed

* src/common.h (ENOTSUP): Make sure this error code is defined.
* src/util.c (set_file_attributes): Ignore ENOSYS, ENOTSUP, and EPERM errors.
Improve handling of LF vs. CRLF line endings

* src/patch.c (check_line_endings): New function.
(main): When a hunk fails, report when the line endings differ between the
input file and the patch.
* src/pch.c (there_is_another_patch): When saying that we strip trailing CRs,
also say how to turn this off.
* tests/crlf-handling: Update changed messages.  Add test case that fails.
Improve messages when in --dry-run mode

* src/patch.c (main): Say that we are checking a file and not that we are
patching it in --dry-run mode.  Don't say "saving rejects to file" when we
don't create reject files.
* tests/reject-format: Add rejects with --dry-run test case.
* tests/bad-filenames, tests/fifo, tests/mixed-patch-types: Update.
Update NEWS

* NEWS: Update.
build: avoid gcc warnings from -Wsuggest-attribute=format

* configure.ac (WARN_CFLAGS): Disable -Wsuggest-attribute=format,
to avoid some warnings that are not worth working around.
Only expect files to become empty if the patch says so

Test cases based on patches from Dmitry V. Levin <ldv@altlinux.org>.
* src/patch.c (main): Only expect files to become empty if the patch says so.
* NEWS: Document this change.
* tests/create-delete: Add (more) empty vs. non-empty test cases.
Improve the previous commit

* src/patch.c: Only print the "file is not empty after patch" message when
trying to delete the output file.  Say that we were trying to delete the file.
* tests/create-delete: Fix the expected messages.  Add test cases for the
--remove-empty-files and --posix options.
* NEWS: Better describe this change.
Trailing whitespace fix

* NEWS: Trailing whitespace fix.
Use gnulib errno module instead of our own default ENOTSUP fallback

* bootstrap.conf (gnulib_modules): Add errno module.
* src/common.h: Remove ENOTSUP fallback.
Repair 'backup of unmodified file' test

tests/create-delete: Repair 'backup of unmodified file' test.
build: update gnulib submodule to latest
Version 2.7.1
Don't fail test suite if printf '\0' is broken

* tests/create-delete: Skip binary diff test if printf '\0' is broken.
Initialize data structures early enough

* src/patch.c (main): Initialize data structures early enough, before error
paths can access them.
* tests/bad-usage: Test bad command line usage.
* tests/Makefile.am (TESTS): Add bad-usage here.