*** ../vim-7.3.013/src/ex_getln.c 2010-09-21 16:56:29.000000000 +0200
--- src/ex_getln.c 2010-09-29 15:47:56.000000000 +0200
***************
*** 2342,2356 ****
windgoto(msg_row, msg_col);
pend = (char_u *)(line_ga.ga_data) + line_ga.ga_len;
! /* we are done when a NL is entered, but not when it comes after a
! * backslash */
! if (line_ga.ga_len > 0 && pend[-1] == '\n'
! && (line_ga.ga_len <= 1 || pend[-2] != '\\'))
! {
! --line_ga.ga_len;
! --pend;
! *pend = NUL;
! break;
}
}
--- 2342,2372 ----
windgoto(msg_row, msg_col);
pend = (char_u *)(line_ga.ga_data) + line_ga.ga_len;
! /* We are done when a NL is entered, but not when it comes after an
! * odd number of backslashes, that results in a NUL. */
! if (line_ga.ga_len > 0 && pend[-1] == '\n')
! {
! int bcount = 0;
!
! while (line_ga.ga_len - 2 >= bcount && pend[-2 - bcount] == '\\')
! ++bcount;
!
! if (bcount > 0)
! {
! /* Halve the number of backslashes: "\NL" -> "NUL", "\\NL" ->
! * "\NL", etc. */
! line_ga.ga_len -= (bcount + 1) / 2;
! pend -= (bcount + 1) / 2;
! pend[-1] = '\n';
! }
!
! if ((bcount & 1) == 0)
! {
! --line_ga.ga_len;
! --pend;
! *pend = NUL;
! break;
! }
}
}
*** ../vim-7.3.013/src/version.c 2010-09-29 13:02:48.000000000 +0200
--- src/version.c 2010-09-29 15:45:57.000000000 +0200
***************
*** 716,717 ****
--- 716,719 ----
{ /* Add new patch number below this line */
+ /**/
+ 14,
/**/
--
hundred-and-one symptoms of being an internet addict:
224. You set up your own Web page. You set up a Web page for each
of your kids... and your pets.
/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
> I managed to miss this posting until now, so I'm only 45 or so days
> late. I appreciate that you kept this request in the queue and
> worked on it after the release of 7.3!
>
> I've tried this with VIM (EX) 7.3.62, and it still produces a
> different result than the 6.3 version we're running on RHEL4.
>
>
> To recreate the problem, perform the following:
> cat - > ex.input << EOF
> a
> X \\
> Y
> .
> w ex.output
> EOF
> cat -tvse ex.input
> ex - -u NONE < ex.input
> cat -tvse ex.output
>
> When working correctly (rhel4), the output from cat of ex.output is:
> $
> X \$
> Y$
>
> On rhel5, the output from cat of ex.output is:
> X \^@Y$
Have a look at ex.input:
a$
X \$
Y$
.$
w! ex.output$
You have a backslash at the end of the line. That means the line break
is taken literally. You need to double the backslash if you want a
backslash at the end of the line.
My old "original vi" doesn't run right now, thus I can't verify how it
handles this. It's a bit difficult to tell what would be the correct
way to handle this.
--
The chat program is in public domain. This is not the GNU public license.
If it breaks then you get to keep both pieces.
-- Copyright notice for the chat program
/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
> Bram, et al-
>
> The main complaint here is that the current versions of vim/ex (7.x) crushes
> the \<newline> (Backslash newline) to a <null>, which is shown as a "^@" in
> the output of cat -tvse.
>
> Our reference 'ex' version is from HP-UX 11.x. The output of VIM 6.3 and
> the reverence vi agree, but from VIM 7.0 on, we get the \<newline> =
> <nul>. I've recompiled 6.3 on our RHEL5 systems, and have confirmed that
> 6.3 produces the expected reference output.
What is the :version output of the HP-UX version?
> --0016364994cdbb364504955ae796
> Content-Type: text/html; charset=ISO-8859-1
> Content-Transfer-Encoding: quoted-printable
>
> Bram, et al-<br><br>The main complaint here is that the current versions of=
> vim/ex (7.x) crushes the \<newline>=A0 (Backslash newline) to a <=
> null>, which is shown as a "^@" in the output of cat -tvse.<br=
> >
> <br>Our reference 'ex' version is from HP-UX 11.x.=A0=A0 The output=
> of VIM 6.3 and the reverence vi agree, but from VIM 7.0 on, we get the \&l=
> t;newline> =3D <nul>.=A0=A0 I've recompiled 6.3 on our RHEL5 s=
> ystems, and have confirmed that 6.3 produces the expected reference output.=
> <br>
> <br>My goal is to get VIM 7.x to match the 6.3, and by extension the refere=
> nce 'ex' behavior.=A0=A0=A0 <br><br>A number of files use the \<=
> ;newline> construct, for example the NIS netgroup file:<br><br><div styl=
> e=3D"margin-left: 40px;">
> build1 (<a href=3D"http://pdbuild0.tech.net">pdbuild0.tech.net</a>,-,pd) \<=
> br>=A0=A0=A0=A0=A0 (<a href=3D"http://pdbuild1.tech.net">pdbuild1.tech.net<=
> /a>,-,pd) \<br>=A0=A0=A0=A0=A0 (<a href=3D"http://pdbuild2.tech.net">pdbuil=
> d2.tech.net</a>,-,pd) \<br>
> =A0=A0=A0=A0=A0 (<a href=3D"http://pdbuild3.tech.net">pdbuild3.tech.net</a>=
> ,-,pd) \<br>=A0=A0=A0=A0=A0 (<a href=3D"http://pdbuild4.tech.net">pdbuild4.=
> tech.net</a>,-,pd) \<br>=A0=A0=A0=A0=A0 (<a href=3D"http://pdbuild5.tech.ne=
> t">pdbuild5.tech.net</a>,-,pd) \<br>
> =A0=A0=A0=A0=A0 (<a href=3D"http://pdbuild6.tech.net">pdbuild6.tech.net</a>=
> ,-,pd) \<br>=A0=A0=A0=A0=A0 (<a href=3D"http://pdbuild7.tech.net">pdbuild7.=
> tech.net</a>,-,pd) \<br>=A0=A0=A0=A0=A0 (<a href=3D"http://pdbuild8.tech.ne=
> t">pdbuild8.tech.net</a>,-,pd) \<br>
> =A0=A0=A0=A0=A0 (<a href=3D"http://pdbuild9.tech.net">pdbuild9.tech.net</a>=
> ,-,pd)<br></div><br>At $WORK, we have a number of scripted processes that c=
> hew on files that look like this, and when the \<newline> gets conve=
> rted to a <nul>, the resulting output is incorrect.<br>
> <br>So, I would submit that a \<newline> should be output as \<n=
> ewline> by ex.<br><br><br><div class=3D"gmail_quote"><blockquote class=
> =3D"gmail_quote" style=3D"margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid=
> rgb(204, 204, 204); padding-left: 1ex;">
>
> Have a look at ex.input:<br>
> <br>
> a$<br>
> X \$<br>
> Y$<br>
> .$<br>
> w! ex.output$<br>
> <br>
> <br>
> You have a backslash at the end of the line. =A0That means the line break<b=
> r>
> is taken literally. =A0You need to double the backslash if you want a<br>
> backslash at the end of the line.<br>
> <br>
> My old "original vi" doesn't run right now, thus I can't =
> verify how it<br>
> handles this. =A0It's a bit difficult to tell what would be the correct=
> <br>
> way to handle this.<br>
> <br>
> --<br>
> The chat program is in public domain. =A0This is not the GNU public license=
> .<br>
> If it breaks then you get to keep both pieces.<br>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0-- Copyright notice for the chat program<br=
> >
> <font color=3D"#888888"><br>
> =A0/// Bram Moolenaar -- Br...@Moolenaar.net -- <a href=3D"http://www.Moolen=
> aar.net" target=3D"_blank">http://www.Moolenaar.net</a> =A0 \\\<br>
> /// =A0 =A0 =A0 =A0sponsor Vim, vote for features -- <a href=3D"http://www.=
> Vim.org/sponsor/" target=3D"_blank">http://www.Vim.org/sponsor/</a> \\\<br>
> \\\ =A0an exciting new programming language -- <a href=3D"http://www.Zimbu.=
> org" target=3D"_blank">http://www.Zimbu.org</a> =A0 =A0 =A0 =A0///<br>
> =A0\\\ =A0 =A0 =A0 =A0 =A0 =A0help me help AIDS victims -- <a href=3D"http:=
> //ICCF-Holland.org" target=3D"_blank">http://ICCF-Holland.org</a> =A0 =A0//=
> /<br>
> </font></blockquote></div><br>
>
> --0016364994cdbb364504955ae796--
--
(letter from Mark to Mike, about the film's probable certificate)
I would like to get back to the Censor and agree to lose the shits, take
the odd Jesus Christ out and lose Oh fuck off, but to retain 'fart in
your general direction', 'castanets of your testicles' and 'oral sex'
and ask him for an 'A' rating on that basis.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
What is the :version output of the HP-UX version?