Backport change from trunk:
tests/harness/testsuite.cc: Add safeunistd.h unconditionally for
isatty, required by GCC 4.7

git-svn-id: file:///home/xapian-svn/xapian/branches/1.2@16845 6b2f1b92-a4f3-0310-943f-de3cbe41748b
Backport change from trunk:
common/debuglog.cc: Preserve errno over debug logging calls, so they
can safely be added to code which expects errno not to change.

git-svn-id: file:///home/xapian-svn/xapian/branches/1.2@16846 6b2f1b92-a4f3-0310-943f-de3cbe41748b
Backport change from trunk:
matcher/multimatch.cc: Remove duplicate import

git-svn-id: file:///home/xapian-svn/xapian/branches/1.2@16847 6b2f1b92-a4f3-0310-943f-de3cbe41748b
Backport change from trunk:
include/xapian/enquire.h: Clarify that the "reverse" parameter of
set_sort_by_relevance_then_value() and
set_sort_by_relevance_then_key() only affects the ordering of the
value/key part of the sort.

git-svn-id: file:///home/xapian-svn/xapian/branches/1.2@16848 6b2f1b92-a4f3-0310-943f-de3cbe41748b
Backport change from trunk:
include/xapian/termgenerator.h,queryparser/termgenerator.cc,
queryparser/termgenerator_internal.cc,
queryparser/termgenerator_internal.h,tests/termgentest.cc: Add new
method TermGenerator::set_max_word_length() to allow this limit to
be adjusted by the user.

git-svn-id: file:///home/xapian-svn/xapian/branches/1.2@16849 6b2f1b92-a4f3-0310-943f-de3cbe41748b
Backport change from trunk:
queryparser/termgenerator_internal.cc: Remove "FIXME: Add API to
allow control of how stemming is used?", as we have now added such
an API.

git-svn-id: file:///home/xapian-svn/xapian/branches/1.2@16850 6b2f1b92-a4f3-0310-943f-de3cbe41748b
Backport changes from trunk:
tests/harness/unixcmds.cc: Escape filenames on POSIX platforms by
wrapping in single quotes and specially handling single quotes in
the filename - previously newlines in filenames got eaten by the
shell.
tests/harness/unixcmds.cc: Protect filenames which start with '-' on
MS Windows like we already do on other platforms.  The built-in
commands generally only interpret '/' as the character introducing a
command line option (which we already convert to '\'), but many
ported programs understand '-' too/instead.

git-svn-id: file:///home/xapian-svn/xapian/branches/1.2@16853 6b2f1b92-a4f3-0310-943f-de3cbe41748b
Backport change from trunk:
common/Makefile.mk,common/append_filename_arg.h,
tests/harness/unixcmds.cc: Split out append_filename_argument() into
its own file so it can be used elsewhere.

git-svn-id: file:///home/xapian-svn/xapian/branches/1.2@16854 6b2f1b92-a4f3-0310-943f-de3cbe41748b
Backport change from trunk:
HACKING: Try to make it clearer we're looking for a dual-licence
on submitted patches.

git-svn-id: file:///home/xapian-svn/xapian/branches/1.2@16855 6b2f1b92-a4f3-0310-943f-de3cbe41748b
Backport change from trunk:
include/xapian/queryparser.h: Add extra DateValueRangeProcessor
constructor overloaded form so that in DateValueRangeProcessor(1,
"date:"), the const char * gets interpreted as std::string rather
than bool.
tests/queryparsertest.cc: Add regression test.

git-svn-id: file:///home/xapian-svn/xapian/branches/1.2@16856 6b2f1b92-a4f3-0310-943f-de3cbe41748b
Backport change from trunk:
include/xapian/queryparser.h: Fix documentation comment typos:
"covert" -> "convert".

git-svn-id: file:///home/xapian-svn/xapian/branches/1.2@16857 6b2f1b92-a4f3-0310-943f-de3cbe41748b
Backport change from trunk:
urldecode.h: Fix to decode escaped character at the end of the
string.
urlenctest.cc: Add regression testcase.

git-svn-id: file:///home/xapian-svn/xapian/branches/1.2@16858 6b2f1b92-a4f3-0310-943f-de3cbe41748b