Fix for bug #814830 from upstream svn 7021
2016-02-15  Gavin Smith  <gavinsmith0123@gmail.com>

       * doc/texinfo.tex (\setchapterstyle, \headings, \setchapternewpage)
       (\everyheadingmarks, \everyfootingmarks): Define with 
       \parseargdef to read argument on the line instead of delimiting 
       the argument with a space.  This is necessary in case newlines 
       are active, which is the case at the very start of the file due 
       to the definitions in \enablebackslashhack.  Broken 
       @setchapternewpage reported by Norbert Preining.
       (\enablebackslashhack): Turn off special meanings after two 
       active newlines instead of after three, and add comments to 
       explain what is going on.
---
 doc/texinfo.tex |   17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

--- texinfo.orig/doc/texinfo.tex
+++ texinfo/doc/texinfo.tex
@@ -3,7 +3,7 @@
 % Load plain if necessary, i.e., if running under initex.
 \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
 %
-\def\texinfoversion{2016-02-05.07}
+\def\texinfoversion{2016-02-05.07.deb1}
 %
 % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
 % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
@@ -3513,9 +3513,9 @@
 \def\oddheadingmarks{\headingmarks{odd}{heading}}
 \def\evenfootingmarks{\headingmarks{even}{footing}}
 \def\oddfootingmarks{\headingmarks{odd}{footing}}
-\def\everyheadingmarks#1 {\headingmarks{even}{heading}{#1}
+\parseargdef\everyheadingmarks{\headingmarks{even}{heading}{#1}
                           \headingmarks{odd}{heading}{#1} }
-\def\everyfootingmarks#1 {\headingmarks{even}{footing}{#1}
+\parseargdef\everyfootingmarks{\headingmarks{even}{footing}{#1}
                           \headingmarks{odd}{footing}{#1} }
 % #1 = even/odd, #2 = heading/footing, #3 = top/bottom.
 \def\headingmarks#1#2#3 {%
@@ -3536,7 +3536,7 @@
 % By default, they are off at the start of a document,
 % and turned `on' after @end titlepage.
 
-\def\headings #1 {\csname HEADINGS#1\endcsname}
+\parseargdef\headings{\csname HEADINGS#1\endcsname}
 
 \def\headingsoff{% non-global headings elimination
   \evenheadline={\hfil}\evenfootline={\hfil}%
@@ -6071,7 +6071,7 @@
   \fi
 }
 
-\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
+\parseargdef\setchapternewpage{\csname CHAPPAG#1\endcsname}
 
 \def\CHAPPAGoff{%
 \global\let\contentsalignmacro = \chappager
@@ -6220,7 +6220,7 @@
 % I don't think this chapter style is supported any more, so I'm not
 % updating it with the new noderef stuff.  We'll see.  --karl, 11aug03.
 %
-\def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
+\parseargdef\setchapterstyle{\csname CHAPF#1\endcsname}
 %
 \def\unnchfopen #1{%
   \chapoddpage
@@ -11116,9 +11116,10 @@
   @global@let\ = @eatinput%
   @catcode`@^^M=13%
   @def@c{@fixbackslash@c}%
+  % Definition for the newline at the end of this file.
   @def ^^M{@let^^M@secondlinenl}%
-  @gdef @secondlinenl{@let^^M@thirdlinenl}%
-  @gdef @thirdlinenl{@fixbackslash}%
+  % Definition for a newline in the main Texinfo file.
+  @gdef @secondlinenl{@fixbackslash}%
 }}
 
 {@catcode`@^=7 @catcode`@^^M=13%
